neppers Posted March 1, 2006 Share Posted March 1, 2006 I`m trying to make a payment method, but I need to forward the "order_total"-field from my mysql-database without decimals. Now I get f.ex an order_total like this "1679.00". I need it to be "167900". Anyone have an idea?Sample from the code: <input type="hidden" name="amount" value="<?php $db->p("order_total") ?>" /> Quote Link to comment https://forums.phpfreaks.com/topic/3810-insert-from-mysql-with-no-decimal/ Share on other sites More sharing options...
cheyner11 Posted March 1, 2006 Share Posted March 1, 2006 perhaps you could send the info into the database without the decimal. Then format the info if you ever needed to display it with a decimal.The best way to remove the decimal is using REGEX. Quote Link to comment https://forums.phpfreaks.com/topic/3810-insert-from-mysql-with-no-decimal/#findComment-13232 Share on other sites More sharing options...
Barand Posted March 1, 2006 Share Posted March 1, 2006 Multiply order total by 100 Quote Link to comment https://forums.phpfreaks.com/topic/3810-insert-from-mysql-with-no-decimal/#findComment-13240 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.