MySQL Forums
Forum List  »  Newbie

Re: Decimal fields in tables
Posted by: fio productions
Date: February 17, 2012 09:09AM

Thanks for your quick reply.

Yes you are right. But if the user inserts the next value of 10.50 on the same table and same field which was created as a decimal(9,3), it messes all up.
As I said before the database table is:

id
name
category
qty
unitprice
total

If I make the 'unitprice' a decimal(8,2) it restricts to only that! the same
if I make it decimal(9,3), the user wont be able to put small decimals.
I need it to accept decimals of any size. if the user buys something £100.000, and then a minute afterwards he buys something which costs £27.80 , it should be possible to have on the same table column.

This must be a stupid question or problem, as I found no reference on that.
And the fact that I dont seem to get over it, I find it somehow terrifying.
Thanks for your help and time,

Mike

Options: ReplyQuote


Subject
Written By
Posted
February 16, 2012 01:57PM
February 16, 2012 02:36PM
February 16, 2012 02:16PM
February 16, 2012 08:41PM
February 17, 2012 07:53AM
February 17, 2012 11:18AM
Re: Decimal fields in tables
February 17, 2012 09:09AM
February 17, 2012 05:58PM
February 18, 2012 02:41AM
February 18, 2012 10:04AM
February 18, 2012 11:00AM
February 18, 2012 12:14PM
February 18, 2012 04:28PM
February 18, 2012 10:53AM
February 18, 2012 06:16PM
February 18, 2012 07:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.