Why is this not working?
"UPDATE table SET value=truncate(2.33612e+006, 2)"
Is MySQL unable to round very small floats or floats of high precision?
Rounding in MySQL
Moderator: General Moderators
Re: Rounding in MySQL
I would guess that is is working as you have no decimals to truncate.
[text]mysql> select truncate(2.33612e+006, 2);
+---------------------------+
| truncate(2.33612e+006, 2) |
+---------------------------+
| 2336120.00 |
+---------------------------+
1 row in set (0.00 sec)
[/text]
[text]mysql> select truncate(2.33612e+006, 2);
+---------------------------+
| truncate(2.33612e+006, 2) |
+---------------------------+
| 2336120.00 |
+---------------------------+
1 row in set (0.00 sec)
[/text]
Re: Rounding in MySQL
You have to remember Truncate is working with the FULL number, I have a feeling you were wanting it to be 2.33e+06, that is just a visual representation, not the actual value it acts upon.