vikingbear Posted April 4, 2010 Share Posted April 4, 2010 Hi, I have a database field containing a number eg. 3.75, I want to repeat the field in the next column and add 10% (gst) how would I code that? <?php echo $row_Recordset1['Price_75mm']; ?> | <?php echo $row_Recordset1['Price_75mm']; ?> Any input greatly appreciated! Regards, ken Link to comment https://forums.phpfreaks.com/topic/197516-add-gst-automatically/ Share on other sites More sharing options...
Daniel0 Posted April 4, 2010 Share Posted April 4, 2010 Uh, multiply by 1.1? Link to comment https://forums.phpfreaks.com/topic/197516-add-gst-automatically/#findComment-1036666 Share on other sites More sharing options...
vikingbear Posted April 4, 2010 Author Share Posted April 4, 2010 Clever answer, but HOW I am not a php coder, cheating by using Dreamweaver.. Regards, Ken Link to comment https://forums.phpfreaks.com/topic/197516-add-gst-automatically/#findComment-1036669 Share on other sites More sharing options...
ignace Posted April 4, 2010 Share Posted April 4, 2010 $row_Recordset1['Price_75mm'] * 1.1 Link to comment https://forums.phpfreaks.com/topic/197516-add-gst-automatically/#findComment-1036672 Share on other sites More sharing options...
vikingbear Posted April 4, 2010 Author Share Posted April 4, 2010 Works brilliantly, but how do you round up to 2 decimals Regards, Ken Link to comment https://forums.phpfreaks.com/topic/197516-add-gst-automatically/#findComment-1036674 Share on other sites More sharing options...
Daniel0 Posted April 4, 2010 Share Posted April 4, 2010 You round using the round function. Link to comment https://forums.phpfreaks.com/topic/197516-add-gst-automatically/#findComment-1036677 Share on other sites More sharing options...
ZachMEdwards Posted May 29, 2010 Share Posted May 29, 2010 <?php echo round($row_Recordset1['Price_75mm']*1.1,2); ?> | <?php echo round($row_Recordset1['Price_75mm']*1.1,2); ?> Link to comment https://forums.phpfreaks.com/topic/197516-add-gst-automatically/#findComment-1065188 Share on other sites More sharing options...
ignace Posted May 30, 2010 Share Posted May 30, 2010 <?php echo round($row_Recordset1['Price_75mm']*1.1,2); ?> | <?php echo round($row_Recordset1['Price_75mm']*1.1,2); ?> He said second column <?php echo $row_Recordset1['Price_75mm']; ?> | <?php echo round($row_Recordset1['Price_75mm']*1.1,2); ?> Link to comment https://forums.phpfreaks.com/topic/197516-add-gst-automatically/#findComment-1065258 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.