NumberFormat.formatTableValue

Syntax

formatTableValue (tableValue);

Parameters

tableValue. A string that contains a number with the thousand separator " " or the decimal separtor ",".

Description

The formatTableValue method returns string view of a value with thousand separator " " or decimal separator ",".

Example

To execute the example, the HTML page must contain links to the PP.js library and PP.css styles. Add a text area:

//Create a text area
ta = new PP.Ui.TextArea({
    ParentNode: document.body,
    Content: "Enter number"
});
//On changing the contents in the text area the console displays the entered value and string view of the entered number
ta.TextChanged.add(function (sender, args) {
    value = args.Value;
    numbForm = new PP.NumberFormat();
    formValue = numbForm.formatTableValue(value);
    console.log(formValue);
});

After executing the example a text area is placed in the page. Enter a number using the thousand separator " " and/or decimal separator ",", such as 10 000,456. The browser console displays the entered number followed by the number returned with the formatTableValue method:

10 000,456

100004560

See also:

NumberFormat