I am trying to format 1999
into 19.99
using PHP number format.
I tried:
$<?php echo number_format('1999',2); ?>
But I received:
$1,999.00
instead of $19.99
Please help!
Simply divide the number by 100
$<?php echo number_format(1999/100,2); ?>
Try with this code:
echo number_format((1999/100),2);
$<?php
$value = 1999;
echo number_format(($value/100),2);
?>