Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I use currency datatype in Sql server. When i code in C# I use float datatype. Both currency and float are different shows different figures while calculating sums. Please anyone help to avoid this?
Posted
Comments
Richard MacCutchan 6-Jan-11 4:32am    
Never use float/double for currency; always use an integral or specialist decimal numeric type - unless you don't care about accuracy.

1 solution

Decimal datatype is there for equivalent money in SQL.

See the comparison HERE[^] between SQL Datatype and corresponding CLR datatype.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900