how to convert a decimal number with 2 float php code example Example: php float 2 decimais $foo = "105"; echo number_format((float)$foo, 2, '.', '');