field-kit
field-kit copied to clipboard
Demo: Number Formatter example not clear
Just a heads up, I think the number formatter example is broken on the demo page. Or maybe I just don't understand what it's trying to demo?
http://square.github.io/field-kit/
So, I see what's going on now...basically it's just formatting a random number that you receive onload...it's just a bit confusing considering that all the other demos check for, and format, based on what's put in by the user (onchange).
Good point, I think there has been others confused with this as well. I'll come up with another number formatter demo.
Thanks
We should probably just split it into three: one for currency, one for percentage, and one for normal numbers.
I am still confused on how NumberFormatter works. What is the code actually doing to the input field? For example, the following code still allows letters and other non currency symbols to be entered. As far as I can tell, it functions just like a plain old text input.
new FieldKit.TextField(element, new FieldKit.NumberFormatter().setNumberStyle(FieldKit.NumberFormatter.Style.CURRENCY))