how to get 2 digit value after decimal in php code example Example: fix to 2 decimal places php return number_format((float)$number, 2, '.', '');