I’m trying to create a report using Aspose using some custom attributes like TotalSum (i define them myself)
There is a construction I use:
<<var [grammar = new GrammarScriptlet()]>>
<<[base.TotalSum]:"#,###.00">> <<[grammar.getMoney(new BigDecimal(base.TotalSum))]>>
the expected result is smth like that
1 000.20 (one thousand dollars twenty cents)
but sometime it gives the result like this:
1 000.20 (one thousand dollars nineteen cents)
I investigated this and the reason is that <<[base.TotalSum]:"#,###.00">> rounds the number and <<[grammar.getMoney(new BigDecimal(base.TotalSum))]>> doesn’t
I need these two atributes to match perfectly, if it’s 0.20 cents then it should be twenty cents, not nineteen.
How can I round a number in Aspose? Before using a getMoney function.
I searched here https://docs.aspose.com/words/net/appendix-a-enumeration-extension-methods/ and got nothing.
Please help. Thank you.