PDA

View Full Version : Displaying a number with thousand separator and minimum decimals



tm8747a
17 Feb 2016, 7:16 AM
Is there any way to use the Ext.util.Format.number() function to format numbers so they have a thousand separator and a minimum of 2 decimal places and a max of 6. Here are some examples of what I'd expect before and after formatting:

200 => 200.00
2120.123 => 2,120.123
123.1234567 => 123.123457

Also need a slight variation to make it do this:

200.00 => 200

But I'm kind of assuming if I can figure out how to get the first case done, I'll figure out the second.

tristan.lee
19 Feb 2016, 3:02 PM
You may want to take a look at this UX: https://www.sencha.com/forum/showthread.php?147962-Number-Field-with-currency-symbol-thousand-separator-amp-international-support-ExtJS4