limit two decimal php code example Example: limit two decimal php return number_format((float)$number, 2, '.', '');