In a sql table double floating number like
145.00000000, 2.00000000, 23.12000000, 12.02400000, 0.026, 0.5402,
how i can do these numbers without decimal 0 like with php
145, 2, 23.12, 12.024, 0.026, 0.5402,
In a sql table double floating number like
145.00000000, 2.00000000, 23.12000000, 12.02400000, 0.026, 0.5402,
how i can do these numbers without decimal 0 like with php
145, 2, 23.12, 12.024, 0.026, 0.5402,
Just cast to float
in PHP and it will strip the trailing zeros:
$float = '145.00000000';
echo (float)$float; // 145
$float = '23.12000000';
echo (float)$float; // 23.12