I get a number from database and this number might be either float
or int
.
I need to set the decimal precision of the number to 3
, which makes the number not longer than (regarding decimals) 5.020
or 1518845.756
.
Using PHP
round($number, $precision)
I see a problem:
It rounds the number. I need a function to only cut the decimals short, without changing their values which round( )
seems not to follow.