comma decimal separator
how can I setCellFormat and setTextformat for numeric fields having comma for decimal separator?
October 13,
var myData = [
["Number formats", "123456,889"],
["Number formats", "123456,78901"],
["Number formats", "123456,7890"],
["Number formats", "123456,78"],
["Number formats", "23456,78"]
];
var number = new AW.Formats.Number;
number.dataToValue1= number.dataToValue;
number.dataToValue=function(v){
v=v.replace(/\,/gi, ".")
return this.dataToValue1(v)
};
// number.setTextFormat("#.###,");
// 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(5);
document.write(obj);
obj.onCellClicked = function(event, col,row){
alert(this.getCellValue(col,row) )
}
This topic is archived.
ActiveWidgets is a javascript library for creating user interfaces. It offers excellent performance for complex screens while staying simple, compact and easy to learn. Deployed by thousands of commercial customers in more than 70 countries worldwide.
Copyright © ActiveWidgets 2021