chinwan Posted July 26, 2009 Share Posted July 26, 2009 I have the following line: $tags[] = $this->MakeXMLTag('creditcardpercent', $paymentDetails['creditcardpercent'], true); The way the number is stored in $paymentDetails['creditcardpercent'] is ".10" with a decimal point. I want it that when it pulls in the data to the xml tag, it will strip the decimal point. Any suggestions? Thank You Quote Link to comment https://forums.phpfreaks.com/topic/167520-solved-when-making-xmltag-how-to-strip-away-a-decimal-point-from-the-data/ Share on other sites More sharing options...
ignace Posted July 26, 2009 Share Posted July 26, 2009 $paymentDetails['creditcardpercent'] = str_replace('.', '', $paymentDetails['creditcardpercent']); Quote Link to comment https://forums.phpfreaks.com/topic/167520-solved-when-making-xmltag-how-to-strip-away-a-decimal-point-from-the-data/#findComment-883395 Share on other sites More sharing options...
chinwan Posted July 26, 2009 Author Share Posted July 26, 2009 Thanks it worked. Quote Link to comment https://forums.phpfreaks.com/topic/167520-solved-when-making-xmltag-how-to-strip-away-a-decimal-point-from-the-data/#findComment-883397 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.