caseyryan/flutter_multi_formatter

[Feature] Add Decimal separator

Closed this issue · 5 comments

Can you add a decimal separator as well?

There can only be 2 possible decimal separators: a comma and a period. Both of them can be selected by setting up a correct thousand separator. I don't see a situation where something else might be required since there is no phone keyboard that can use some other separator.
Can you explain what you mean?

There can only be 2 possible decimal separators: a comma and a period. Both of them can be selected by setting up a correct thousand separator. I don't see a situation where something else might be required since there is no phone keyboard that can use some other separator. Can you explain what you mean?

Sorry for the late response. There is a known bug for samsung devices where the keyboard does not respect the device region format. So, for formats where decimal is , the samsung keyboard will display a greyed out , and a ..

I believe that forcing the decimal separator (only , and .) would fix this issue, apparently.

Ref flutter/flutter#61175

Unfortunately I don't have a Samsung device to test it, so I doubt if I can fix it somehow. I would greatly appreciate it if you could fix the issue (if you have a device like this) and make a pull request

Unfortunately I don't have a Samsung device to test it, so I doubt if I can fix it somehow. I would greatly appreciate it if you could fix the issue (if you have a device like this) and make a pull request

I don't think you need a device, just letting the dev choose the decimal character will automatically fix it. There is no way to "detect" the keyboard atm -- afaik

It is possible only if you change thousand separator. If you set thousandSeparator to ThousandSeparator.Period then the mantissa part will automatically be comma. You can also set it to ThousandSeparator.SpaceAndCommaMantissa
There is also an open issue here that it's impossible to enter a comma as a decimal separator but I also can't reproduce it on my devices, nor on a simulator. So you may give it a try.
I know it's not the best possible solution since some countries traditionally use commas as a thousand separator but a space might do instead.
It seems like a potential issue for me as well but I don't know how to fix it yet without some terrible hacks