CottaCush / CurrencyEditText

💰 A library to dynamically format your EditTexts to take currency inputs
Apache License 2.0
131 stars 28 forks source link

decimal places #41

Closed lpsistemas01 closed 1 year ago

lpsistemas01 commented 1 year ago

it is not accepting decimal places. I click on the dot or comma and nothing happens, the number remains whole.

efguydan commented 1 year ago

Hello @lpsistemas01 , Can you add more details to this question?

Such as the Locale you are using & possibly a screen recording to help visualize this one.

Thanks.

CaiqueCoelho commented 1 year ago

It's not working for pt-BR, for example, I couldn't make 27,38 where 38 is a decimal because I'm getting 2.378. In Brazil, we use commas for the decimals

efguydan commented 1 year ago

Hey @CaiqueCoelho , this bug is an EditText bug and unfortunately it hasn't been fixed. There are lot of workarounds by the community. I would recommend this one as it looks simplest.

https://stackoverflow.com/a/16772758

 editText.keyListener = DigitsKeyListener.getInstance("0123456789.,") // You can customize the accepted keys you want.

Let me know if it helps. Thanks

thtmorais commented 1 year ago

Hey @CaiqueCoelho , this bug is an EditText bug and unfortunately it hasn't been fixed. There are lot of workarounds by the community. I would recommend this one as it looks simplest.

https://stackoverflow.com/a/16772758

 editText.keyListener = DigitsKeyListener.getInstance("0123456789.,") // You can customize the accepted keys you want.

Let me know if it helps. Thanks

It's work for pt-BR!!!

efguydan commented 1 year ago

Great to hear. Closing this one