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? Link to comment https://forums.phpfreaks.com/topic/39229-get-number-in-ones-column/ Share on other sites More sharing options...
ToonMariner Posted February 19, 2007 Share Posted February 19, 2007 number_format() Link to comment https://forums.phpfreaks.com/topic/39229-get-number-in-ones-column/#findComment-189004 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 Link to comment https://forums.phpfreaks.com/topic/39229-get-number-in-ones-column/#findComment-189009 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>'; } ?> Link to comment https://forums.phpfreaks.com/topic/39229-get-number-in-ones-column/#findComment-189028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.