PP.NumberFormat.maskFormat(mask, value);
mask. Number mask.
value. Number.
The maskFormat static method returns the number formatted according to the specified mask.
Available mask values are described on the Number Format page, in the All Formats section.
To execute the example the page must contain a link to PP.js library. Show values calculated in accordance with different masks to the browser console:
Mask:
PP.NumberFormat.maskFormat("# %", 100);
Result:
"100 %"
Mask:
PP.NumberFormat.maskFormat("$ ##0,##", 123456789);
Result:
"$ 123 456 789"
Mask:
PP.NumberFormat.maskFormat("\"begin\" ##0,# \"end\"", 123456789);
Result:
"begin 123 456 789 end"
See also: