stop rounding
stop rounding
![rldean1](https://secure.gravatar.com/avatar/c9be3e8e0a2850a1329d45a7294eae2c/?default=https%3A%2F%2Fvanillicon.com%2Fc9be3e8e0a2850a1329d45a7294eae2c_200.png&rating=g&size=120)
How do I stop Datatables from rounding?
I've encountered a column with decimal(38,30)
... 38 total spaces, with a possibility of 30 spaces to the right of the decimal.
1.012345678901234567890
-- I would prefer to display the raw value
1.0123456789012346
-- not the rounded value.
Do I use render
to make it like I want it? Do I set the column's datatype somehow?
However, if it's zeros, I'm cool with dropping those.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
That's more a Javascript limitation than a Datatables limit. Go to your browser's console and paste
1.012345678901234567890
. The result will be1.0123456789012346
.One option to display the raw value is to return the value as text. You can then convert it, in Javascript, to a floating point number if you need to do calculations. I believe the precision is around 20 digits.
Kevin