Jump to content

Archived

This topic is now archived and is closed to further replies.

neppers

Insert from mysql with no decimal

Recommended Posts

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") ?>" />

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.