gtgalone/currency_text_input_formatter

Issue on format with CurrencyTextInputFormatter

atsen-dev opened this issue · 2 comments

Hi,

I just want to share an issue than annoy me with CurrencyTextInputFormatter is that if I want to format that value : 20.0 , It will format as 2.00 for example.

In my case I want to init an input with 131.0 (double value) as value and that is my output using formatter :
image

Did you know that issue ?

The issue come from this part of the plugin (line 95) :
image

EDIT :

As you can see input is 131 but after line 95, _newNum is 1.31

The only workaround I found is to format every value with thr right precision like this :
image

I thinks It would be great If we can improve that to be able to set a double value without the need of the workaround

I had the same issue as you. Instead of using .format method, use .formatDouble.