1.11M Members

Insert decimal value in price field

 
0
 

Hi I am doing a Tizag tutorial.I have created this table products with phpMyAdm in and started to populate the field.When it comes to price if I insert 13.99 the amount is rounded up to 14.I have tried everything changing to decimal, float, double but nothing seems to work,it keeps rounding up the amount.Can somebody figure out what is the problem? This is important as I'll have to insert decimal values a lot.Thank you.

 
0
 

Can you post the code? We can then see any maybe problems.

 
0
 

Tizag mysql tutorial-groupby
Table Products-DB test
All the price column amounts get rounded up to the next dollat example id 123451 Park's Great Hits Music Price 19.99 my select query shows 20.00 and same for all other columns 3.99 to 4.00 and so on.
The table structure is id int(10)name varchar(20)type varchar(30)price-I've tried everyone decimal,float,double the result is still the same the amount is rounded up.Cannot figure it out.Thanks

 
0
 

try-
price type DECIMAL length 4,2
the ',2' being the number of decimal places.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: