print decimal(15 2) in php from database code example Example: fix to 2 decimal places php return number_format((float)$number, 2, '.', '');