Which dependency is removing comma zero values and how to stop it?
-
Hello,
I have an item with a value of "300.00". I'd like jsreport to display the full value with the ".00" but some dependency or setting is omitting it and only displaying "300" instead.
Playground example:
https://playground.jsreport.net/w/anon/uD5yZQXV
Thanks
-
hi! your value is not changing because of some dependency or some setting being applied, your value changes from
300.00
to300
because that is how JSON works, it omits the.00
for values that don't have meaningful decimal points when it is being parsed into a javascript object.If you want to ensure a format or specific decimal points for your numbers you can use any of these options:
Number.toFixed(2)
Intl.NumberFormat
- any javascript library that helps you format numbers in specific format
here is updated playground example that uses
Number.toFixed(2)