I am getting sql exception (Arithmetic overflow error) for type money.How to set min and max value for money in c#. my sql type is money and C# datatype is double. Range of money is (-922,337,203,685,477.5808) to (922,337,203,685,477.5807).
You should use decimal for money operations. Decimal - specific type which is what you need when it comes to money manipulations. So if it is important for you to have precisely correct results - use it. Otherwise - double is fine.
double (System.Double) ±5.0 x 10-324 to ±1.7 x 10308 with 15 or 16 significant figures
decimal (System.Decimal) ±1.0 x 10-28 to ±7.9 x 1028 with 28 or 29 significant figures
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With