This is a migrated thread and some comments may be shown as answers.

Grid incorrectly truncates long integral types when parsing

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
luke
Top achievements
Rank 1
luke asked on 03 Jan 2021, 09:26 PM

I have a long variable.

Normally, there are no problem displaying this value on the grid.
However, when the value gets very large, it gets truncated.

Original value: 144254210960752435
Truncated value: 144254210960752420

The original value is still within the max range of long, so the truncation shouldn't happen.
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types

At the moment, the only workaround I can think of, is to create a string variable to store the long value, and have grid display that string variable instead.

Is there a better way to resolve this problem?

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 06 Jan 2021, 02:05 PM

Hi Luke,

Thank you for the provided image and details.

Unfortunately, this one is a part of the JavaScript limitations:

You are totally correct about the workaround. Use the "toString" method for the purpose.

Let me know if I could assist with anything else.

Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
luke
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
Share this question
or