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

Can't add decimal and cents using NumberFormatBase and Intl.NumberFormat #781

Open
NwosaEmeka opened this issue Jul 27, 2023 · 1 comment

Comments

@NwosaEmeka
Copy link

I have been trying to format my currency input to have decimal and cents values but it's not being accepted. I'm using the example in the documentation here https://codesandbox.io/s/custom-numeric-format-ovl6km?from-embed.

I want my input to be of this value $100.25 but so far unable to do so and it seems format has been removed from NumericFormat

I would appreciate a help on this

@s-yadav
Copy link
Owner

s-yadav commented Jul 29, 2023

Isn't NumericFormat helpful. to you? Seems like whatever you mentioned is already covered on NumericFormat.
However if you have very specific need, you can patch format method coming from useNumericFormat hook. See this example.
https://s-yadav.github.io/react-number-format/docs/customization#custom-numeral-example

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

2 participants