Does any one know how can I format the number and limited it to only show 1 decimal place in php?
How can I format the number 2.10 to 2.1 in php?
$one_decimal_place = number_format(2.10, 1);
If you ever need to convert it back to a float:
$the_float_value = floatval($one_decimal_place);
Also, this article is a good reference for different decimal characters and separator styles.