react-native-format-currency
react-native-format-currency copied to clipboard
Request for Option to Format to Currency Decimal Even When Amount Is a Whole Number
Can we have an argument option to format the amount into specified decimal places, pls?
@mrdonchocho Can you provide an example, please? Are you asking to be able to specify an arbitrary number of decimals vs. using a particular currency format, i.e., USD = "$xx.yy" (2 decimals), etc.?
I'd like to second the motion.
Regarding mrdonchocho's request, I think he wants to see $100.00 even when the user doesn't specify any cents in the input. I think this is desirable in some circumstances, and would be a good configuration option.
I'm requesting the same thing, essentially, especially in the case where the user wants to specify an amount that is a multiple of $.10. In USD, for example, I would want to see $1,000.50 if somebody merely provided 1000.5 as input. Right now, the library outputs $1,000.5, which isn't correct.
Other similar libraries provide options such as a given precision with which to format numbers to achieve this.
Thanks!