NumberFormat.maskFormat

Syntax

PP.NumberFormat.maskFormat(mask, value);

Parameters

mask. Number mask.

value. Number.

Description

The maskFormat static method returns the number formatted according to the specified mask.

Comments

Available mask values are described on the Number Format page, in the All Formats section.

Example

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:

NumberFormat