shadiadiph Posted January 16, 2009 Share Posted January 16, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/141057-solved-displaying-number-problem/ Share on other sites More sharing options...
shadiadiph Posted January 16, 2009 Author Share Posted January 16, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/141057-solved-displaying-number-problem/#findComment-738253 Share on other sites More sharing options...
shadiadiph Posted January 16, 2009 Author Share Posted January 16, 2009 dont worry i solved it already needed to set the number field in the database to decimal Quote Link to comment https://forums.phpfreaks.com/topic/141057-solved-displaying-number-problem/#findComment-738257 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.