What's the best way to format percentage with a Decimal in NAV? I wasn't able to find a good way and keep my variable, TaxPercentage as a Decimal (which I would have preferred). So, I converted it to text using this code:
TaxPercentage := STRSUBSTNO('%1%',ROUND(TotTaxAmount/AmountExclInvDisc*100,2));
Is there a simpler way of doing this? Thanks!
Comments
If you need it as a string use
Are you sure about your ROUND expression? Did you mean ,0.01) instead of ,2)?
Thanks very much for your detailed reply! Your way is much simpler, plus I didn't like my way of keeping numbers as text, in case I need to reuse them in thu future. I didn't understand how to mix formatting with strings, so your explanation helped a lot.
And you're right about ROUND with what I'm trying to accomplish. Thanks very much for pointing that out. I guess I'm too used to Excel.
Thanks again!
Microsoft Dynamics NAV User