Vipul Kelkar

Vipul Kelkar

  • NA
  • 1.9k
  • 569.1k

How to store decimal value in c#

Oct 25 2011 4:11 AM
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)