Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Option to Format to Currency Decimal Even When Amount Is a Whole Number #2

Open
mrdonchocho opened this issue May 19, 2022 · 2 comments

Comments

@mrdonchocho
Copy link

Can we have an argument option to format the amount into specified decimal places, pls?

@btroia
Copy link
Collaborator

btroia commented May 23, 2022

@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.?

@Permusoft
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants