richrock Posted January 13, 2009 Share Posted January 13, 2009 Am I doing this right? (Obviously not, but I need to know if I'm heading in the right direction...) ??? I set up a mysql table : +-------------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+---------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | vat | int(11) | NO | | NULL | | | vat_date | date | NO | | NULL | | | export | int(11) | NO | | NULL | | | export_date | date | NO | | NULL | | | visa | int(11) | NO | | NULL | | | visa_date | date | NO | | NULL | | | amex | int(11) | NO | | NULL | | | amex_date | date | NO | | NULL | | | photo | int(11) | NO | | NULL | | | photo_date | date | NO | | NULL | | | illust | int(11) | NO | | NULL | | | illust_date | date | NO | | NULL | | +-------------+---------+------+-----+---------+----------------+ 13 rows in set (0.00 sec) So I can set up variables for tax rates, fixed charges, and store the date with each so that any invoices/statements for accounts can be calculated against dates they were generated... That's for another day However, when I inserted some test data via phpmyadmin, it rounded up 17.5 to 18 for the VAT, and 2.5 to 3 for the visa rows. I'm not sure how to fix this, so any help would be greatly appreciated. Also, I just copied the INT(11) from other tables but research shows that I could use other values, so could I lower the INT value? I don't mind re-doing the table, but need to keep dates on each numerical value independently. TIA Rich Quote Link to comment https://forums.phpfreaks.com/topic/140656-solved-insert-and-retreive-decimal-figures/ Share on other sites More sharing options...
ngreenwood6 Posted January 13, 2009 Share Posted January 13, 2009 I am not completely sure about this but I believe that the int type only stores whole numbers. I think that you will need to use either double or decimal. You may want to do a search on either of those to find out which one would best suite your application. Quote Link to comment https://forums.phpfreaks.com/topic/140656-solved-insert-and-retreive-decimal-figures/#findComment-736158 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.