Jump to content

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?

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.