jimfog Posted September 19, 2013 Share Posted September 19, 2013 What do you think is the best column type for storing prices? Link to comment Share on other sites More sharing options...
LAs Posted September 19, 2013 Share Posted September 19, 2013 What kind of question is that?! It depends, how big your price value could be. Use float, in that case, you will be able to hold price value with cents. Link to comment Share on other sites More sharing options...
birbal Posted September 19, 2013 Share Posted September 19, 2013 for storing currency best to use decimal. float has issues to loss data in arithmetic operation. Link to comment Share on other sites More sharing options...
thescientist Posted September 19, 2013 Share Posted September 19, 2013 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 More sharing options...
jimfog Posted September 19, 2013 Author Share Posted September 19, 2013 that's a perfectly legitimate question. No need to be condescending. I TOTALLY AGREE...THANKS Link to comment Share on other sites More sharing options...
jimfog Posted September 20, 2013 Author Share Posted September 20, 2013 Ι 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 More sharing options...
birbal Posted September 20, 2013 Share Posted September 20, 2013 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now