What is the best currency format to use in my database in conjunction with my ASP.NET web app. I am not sure if float or decimal is better. Please note, I will not need culture specific settings.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re using SQL Server, you have the ‘money’ type, which translates to a decimal type in .NET.
Decimal is a 128bit base 10 floating point number, rather than a binary floating point (which float/long are), which makes it so that in most cases it doesn’t lose precision, unlike binary floating point numbers, which have accuracy loss as part of their design.
Here’s a nice article explaining decimals and floating point logic in general.