beautify (value: Number, min: Number, max: Number): Number;
value. Number
min. Lowe border of value change range. By default, the parameter value is less by 1% than value of the value parameter.
max. Upper border of value change range. By default, the parameter value is greater by 1% than value of the value parameter.
The beautify static method returns the number in readable form.
To execute the example, create an HTML page and add links to the following JS and CSS file in the <head> tag:
PP.js.
PP.css.
At the end of the document, in the <body> tag specify name of the function to be executed after page body is loaded as a value of the onLoad attribute.
<body class="PPNoSelect" onselectstart="return false;" onload="NumberEditCreate()"> </body>
Add the following script in the <head> tag:
function NumberEditCreate() {
var ne = new PP.Ui.NumberEdit({
ParentNode: document.body,
Width: 200
});
// If value is changed in the value editor, the console displays the entered number in readable form
ne.AfterValueChange.add(function (sender, args) {
value = args.NewValue;
formValue = PP.NumberFormat.beautify(value);
console.log("Beautified value: " + formValue)
});
}
After executing the example the NumberEdit component is placed on the page. After the value is entered to the component, the browser console displays the entered value in readable form.
See also: