PDA

View Full Version : [CLOSED] How to create gridpanel column having a numeric value of lenght more than 19 digits?



DenisEdde
Nov 16, 2014, 2:12 PM
In gridpanel, When choosing a column of type of "int" or "float" and this column have length more than 19 numeric digits it does not show more than 16 digits and the others it put them as zeros.

I have tried to put the column type to "string" but still have the same issue.

How can I show the whole number in a column in gridpanel when the number type in sql database is "numeric(38,0)".

Thanks

Denis Edde

Daniil
Nov 17, 2014, 1:35 PM
Hi Denis,

JavaScript supports only 17 decimal numbers.

For example, if you run this "code" in a browser's javaScript console:

0.111111111111111122
the last "2" is going to be truncated.

It is a general restriction of JavaScript and Ext.NET doesn't affect on that.

So, if you need to show more than 17 decimal numbers, I can recommend to bind a string to the Store, not a number.

One more fact about JavaScript floating point arithmetic. It is not always accurate. Please try to run:

0.2 + 0.1
It results in

0.30000000000000004

Just for your information.

DenisEdde
Nov 18, 2014, 1:56 PM
Hi Daniil,

Great thanks, I didn't know that.