Add zero to rounded number

<?php

$orig_number = 12;
$rounded_number = round($orig_number,1);
if(!strpos($rounded_number,'.')) $rounded_number .= '.0';

?>

0 Comments

You must be logged in to post a comment.