2
Answers

How to store decimal value in c#

Vipul Kelkar

Vipul Kelkar

13y
4.5k
1
Hi Guys,

I have two variables var1 and var2. when i do a divison (var1/var2)  the result is 1.2
How can i store this value in a variable as using DECIMAL rounds it up to 1. same with double
i am doin it this way

decimal temp = var1/var2;  this returns a rounded value :(

Thanks
Answers (2)