Author Topic: Number Formating / compacting  (Read 1450 times)

altyra

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 12
    • View Profile
Number Formating / compacting
« on: May 26, 2020, 09:57:34 pm »
When i try to insert a large number it compacts the number leaving only a "8.40102e+011" for example, is there a way i can display the whole number?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6124
    • View Profile
Re: Number Formating / compacting
« Reply #1 on: May 26, 2020, 10:42:46 pm »
If that's limited to display only, then you can input them as strings "123456789012345678901234567890".

There is limitation on the value of numbers ( usually around 17 digits ) beyond which javascript loses the precision, and displays them in scientific notation beyond certain number of digits.

https://www.w3schools.com/js/js_numbers.asp

pqgrid doesn't have any solution to fix it.

If you are interested to display the numbers in non scientific notation, then this might be helpful to you:

https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript
« Last Edit: May 26, 2020, 10:52:55 pm by paramvir »