Jump to content

storing prices


jimfog
 Share

Recommended Posts

What do you think is the best column type for storing prices?

Link to comment
Share on other sites

for storing currency best to use decimal. float has issues to loss data in arithmetic operation.

Link to comment
Share on other sites

What kind of question is that?!

 

that's a perfectly legitimate question. No need to be condescending.

 

I also agree with birbal, I use decimal to store currency values. usually something like (10,2), but should be changed to best reflect the requirements of your application.

Link to comment
Share on other sites

that's a perfectly legitimate question. No need to be condescending.

 

I TOTALLY AGREE...THANKS

Link to comment
Share on other sites

Ι used decimal(3.2) but I noticed that it cannot accept 10 or 20 for example....why that? I thought the 3 means 3 digit number MAX.

 

I receive a message saying out of range value....

Link to comment
Share on other sites

First param is total digits including integer part and fraction part. Second one is number of fraction part.So (3,2) can be max to 9.99

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...