I would like to truncate numbers at 3 decimals with php :
3.236665   3.236
3.236111   3.236
Thanks
I would like to truncate numbers at 3 decimals with php :
3.236665   3.236
3.236111   3.236
Thanks
To truncate a number up to p decimals, multiply the number by p-th power of 10, truncate the fraction by casting to integer, then divide the result by p-th power of 10.
The following truncates $n up to the 3rd decimal:
intval($n * 1e3) / 1e3;