Click here to Skip to main content
15,891,762 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Plz Plz Help Me
Facing Problem in convert the decimal Number Value Like 0.001 into int. But my case is different i have to found it denominator value e.g 0.001/1000 now i want to calculate 1000 from 0.0001 in C#
Posted
Updated 30-Dec-11 19:50pm
v2
Comments
Sergey Alexandrovich Kryukov 31-Dec-11 2:49am    
What's the problem? School arithmetic?
--SA

1 solution

Can try it,

C#
decimal x = .001M;
int val =Convert.ToInt16( 1 / x);
 
Share this answer
 
Comments
waqar ahmad (Dev) 31-Dec-11 2:00am    
Thank Supriya Srivastav
Supriya Srivastav 31-Dec-11 2:03am    
Welcome....

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