React-number-format: No decimal place

Created on 16 May 2017  Â·  10Comments  Â·  Source: s-yadav/react-number-format

I found just one way how to force component to use Integer not Decimal and it is to set decimalSeparator="". I think it'll be more intuitive to use something like decimalPrecision={0}, but in that case I had 0.undefined written in field. Is it possible to fix it, or explain some better way how to do it?

Most helpful comment

Solution is now decimalScale=0 for those stumbling into this problem.

All 10 comments

set decimalSeparator = {false}

Thanks, maybe it'll be good at least to describe it better in README.md, while you have also another similar issue here https://github.com/s-yadav/react-number-format/issues/39
But i thinks 0.undefined is not something that is wanted

I guess it makes sense to use decimalPrecision={0} instead of decimalSeparator="" or decimalSeparator= {false} as having decimal numbers is related to decimalPrecision not decimalSeparator.

I have a problem for decimal as well.
In the case of Rupiah currency, the thousand separator is "." while the decimal separator is ",".

How can I disallow decimal on the input?

Hey already have done fixes for seperators issue. Will be adding v2.0.0-alpha tonight or tomorrow.

thanks @s-yadav, so to disallow decimal, we will still use decimalSeparator= {false} ?

No the apis are changing little bit. It will be decimalPrecision = 0

On May 24, 2017 09:10, "ErwinLee10" notifications@github.com wrote:

thanks @s-yadav https://github.com/s-yadav, so to disallow decimal, we
will still use decimalSeparator= {false} ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/s-yadav/react-number-format/issues/61#issuecomment-303606721,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC9AvkHQ_hLhM3WireAWWsAykDXKKYm0ks5r86GKgaJpZM4NcfnL
.

waiting v2.0.0-alpha

Fixed in v2.0.0 alpha

Solution is now decimalScale=0 for those stumbling into this problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sezarthiago picture sezarthiago  Â·  7Comments

leonardojobim picture leonardojobim  Â·  3Comments

rioarray picture rioarray  Â·  6Comments

nourahassan picture nourahassan  Â·  5Comments

Krakof picture Krakof  Â·  6Comments