:: Documentation >>

AW.Formats.Number

Numeric formats converter class. Parses the numeric values and applies display formatting rules.

Constructor

 var obj = new AW.Formats.Number; 

Hierarchy

Methods

cloneCreates an object clone.
comparatorReturns comparator function.
dataToTextTransforms the external data to the readable text.
dataToValueTransforms the external data to the native value type.
initInitializes the object.
setErrorTextSets the error text.
setErrorValueSets the error value.
setTextFormatSets the formatting pattern for the text.
setTimeoutCalls the function after the specified delay.
textToDataTransforms the text to the external data format.
textToValueTransforms the text to the native value type.
toStringConverts object to string.
valueToDataTransforms the value to the external data format.
valueToTextTransforms the value to the readable text.

Examples

var myData = [
    ["Number formats", "12345.6789"],
];

var number = new AW.Formats.Number;
number.setTextFormat("USD #,###.##"); // configure formatting

// grid control
var obj = new AW.UI.Grid;
obj.setCellData(myData);
obj.setCellFormat(number, 1); // numbers in the second column
obj.setColumnCount(2);
obj.setRowCount(1);
document.write(obj);

See also

Formats/conversions overview, AW.System.Format (base class), setTextFormat method, setCellFormat method

Comments

Byte to KB Fanny (1)
Aligning text Bernie (1)
currency format not working Jonathan Doklovic (8)
Formats applied to empty cells ANYWAY? Diabolik (5)
Empty data and number format Tof (0)

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5