gibigbig Posted June 21, 2011 Share Posted June 21, 2011 Is there any function to convert numbers like 099,129,009 to just 99,129 and 9? Link to comment https://forums.phpfreaks.com/topic/240020-need-some-help-converting-number-formats/ Share on other sites More sharing options...
TeNDoLLA Posted June 21, 2011 Share Posted June 21, 2011 Does this help: http://fi2.php.net/manual/en/function.number-format.php ? Link to comment https://forums.phpfreaks.com/topic/240020-need-some-help-converting-number-formats/#findComment-1232945 Share on other sites More sharing options...
gibigbig Posted June 21, 2011 Author Share Posted June 21, 2011 well not really, that is formatting decimals and stuff, not really what i want im looking for the opposite of sprintf Link to comment https://forums.phpfreaks.com/topic/240020-need-some-help-converting-number-formats/#findComment-1232952 Share on other sites More sharing options...
fugix Posted June 21, 2011 Share Posted June 21, 2011 http://us3.php.net/manual/en/function.ltrim.php Link to comment https://forums.phpfreaks.com/topic/240020-need-some-help-converting-number-formats/#findComment-1232953 Share on other sites More sharing options...
gibigbig Posted June 21, 2011 Author Share Posted June 21, 2011 figured it out, intval works. Link to comment https://forums.phpfreaks.com/topic/240020-need-some-help-converting-number-formats/#findComment-1232955 Share on other sites More sharing options...
fugix Posted June 21, 2011 Share Posted June 21, 2011 I wouldn't recommend using intval unless your numbers are in string format. If they are in int format, leafing 0's csn cause unexpected results Link to comment https://forums.phpfreaks.com/topic/240020-need-some-help-converting-number-formats/#findComment-1232982 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.