Sunday 2 August 2015

Display a number to 2 decimal places PHP


You can use number_format() to display a number to 2 decimal places PHP

$number = 215;
<?php echo number_format((float)$number, 2, '.', ''); ?>

No comments: