setNumberFormat

build 91111 of DHTMLX v2.5

I’m not able to get setNumberFormat to work as expected. What am I doing wrong?

I have 4 numeric columns in myGrid and I set their formating this way:

DPnt=",";
Sep=" ";
myGrid.setNumberFormat(“0,000.00”,2,DPnt,Sep);
myGrid.setNumberFormat(“0,000.00”,3,DPnt,Sep);
myGrid.setNumberFormat(“0,000.00”,4,DPnt,Sep);
myGrid.setNumberFormat(“0,000.00”,5,DPnt,Sep);
myGrid.init();

I’m interpreting this to mean that a comma will be used as the decimal character and a space as the group separator.

When 87915.89 is displayed, the user sees: 87 915.89,00

You’ll notice that the decimal point remains a period, but “,00” is appended to the right end of the string. However, the group separator is correct.

How do I fix this?

Note, neither “decimal_separator” nor “group_separator” are being set anywhere in my code.

Also, I’m reading your CHM help file. In this topic: “setNumberFormat(mask, cInd, p_sep, d_sep)”, the link under related articles “Formatting Numeric Values” actually takes one to an article about formatting dates.

Thanks,
Karl

When 87915.89 is displayed, the user sees: 87 915.89,00
This issue wasn’t reproduced locally. When 87915.89 is displayed, the user sees: 87 915,89.
Please check if you are using latest version of dhtmlxGrid.

At the top of dhtmlxgrid.js it says: //v.2.5 build 91111

I’m currently running on XP-Pro and using IE v7 and Chrome. This problem happens in both browsers.

I’ll do some more testing. This html page & javascript was written by another programmer and maybe something is happening in code that I’m not familiar with.

Problem fixed. 2 things - it was an issue of me not understanding our code. I also had to play with the sequence of the initialization of the grid.