Using following methods can display only 2 decimal point value.
Method 1:-
<?php $final_total=199.9; $formattedNum = number_format($final_total, 2); echo $formattedNum; ?> Method 2:- <?php
$final_total=199.9;
echo $number = sprintf('%0.2f', $final_total); ?>
For more Interesting, Useful Article & codes visit IT New Code.
0 comments:
Post a Comment