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>
float
int
3>
Its sound like floor with decimals. So you can try something like
floor
floor($number*1000)/1000