jwk811 Posted February 19, 2007 Share Posted February 19, 2007 how can i get the number in the ones column if i didnt know if i had no idea what the number was, like it could be 2,022,399.983 or 3 or 0.00032? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted February 19, 2007 Share Posted February 19, 2007 number_format() Quote Link to comment Share on other sites More sharing options...
jwk811 Posted February 19, 2007 Author Share Posted February 19, 2007 what would i put between the ()s Quote Link to comment Share on other sites More sharing options...
Barand Posted February 19, 2007 Share Posted February 19, 2007 If, by "ones column" you mean the digit immediately preceding the decimal point <?php $numbers = array(2022399.983 , 3 , 0.00032); // NB remove commas from numbers foreach ($numbers as $n) { echo $n, ' --> ', floor($n)%10, '<br>'; } ?> Quote Link to comment 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.