Jump to content

[SOLVED] displaying number problem


shadiadiph

Recommended Posts

I have the following script to display a number

 

$value      = $row["value"];
$newvalue = number_format($value,2);

echo'<td class="tradeinfo"> '.$newvalue.' </td>'

 

problem is it displays fine as long as the number is less than 999,999 displays 27,300.00 999,999.00 etc but when the value is over 1,000,000 it always displays as 999,999.99 ?? the table is set as float 7,2

Link to comment
https://forums.phpfreaks.com/topic/141057-solved-displaying-number-problem/
Share on other sites

mm i just changed float to just float instead of float7,2

 

now it displays the millions and i have changed

 

$newcalue = number_format($value,2,'.', ',');

 

now the problem is when i put 11567307 as the number it only displays 11,567,300.00  how do i stop it rounding the number down?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.