Formatting a float as a percentage in PHP Posted on 2012-10-27 [Saturday] by Jay Jay To format a float value as a percentage in PHP: $formatted = sprintf( '%.2f', $value * 100 );