Pavan Bujji

Pavan Bujji

  • NA
  • 207
  • 36.2k

how to store a decimal value in c# ?.

Sep 20 2017 5:02 AM
Hi frnds,
  
how to store the decimal value  in c# ?.
 
for ex:
   Var1=50
   var2=3000
 
if i do the divison like below
 
(50/3000) 
 
actually it returns 0.01666.
 
my code is :    decimal percentage= (decimal)(var1/var2);
 
but it returns '0' only. But i want to store 0.01666 atleast 0.016.

How can I ?.
 
Thanks & Regards,
Pavan G. 

Answers (1)