Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to Print The Decimal Value Into Divide by Value
For Example
0.5 into 1/2
1.5 into 1 1/2
2.5 into 2 1/2
any value.....

Help Me
Posted
Updated 13-Jul-14 22:12pm
Comments
Richard MacCutchan 14-Jul-14 4:09am    
This is a mathematics (and probably homework), not a programming question. Try thinking about the steps you need to follow to get the results.

this is a dirty way, but it works :

http://www.dreamincode.net/forums/topic/287922-converting-decimals-to-standard-fractions/[^]

or

http://www.c-sharpcorner.com/forums/thread/29984/converting-decimals-to-fractions.aspx[^]

P/s: we dont do your homework, google it urself and try to understand it.
 
Share this answer
 
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

But this isn't a particularly difficult task, and if you google for decimal to fraction algorithm you will find a number of methods. All you have to do then is decide which and implement one!
 
Share this answer
 
Comments
kuldeepkumartak 14-Jul-14 6:08am    
it's not home work. i am developer and now developing a software ii need mm(decimal) to inch(fraction) convert help me????????????
Stefan_Lang 14-Jul-14 10:24am    
That's an entirely different task. I assume you refer to the fact that measurements in inches are often listed as multiples of 1/2, 1/4, or 1/8? That is a way of representing measurements people used to metric units may not be familiar with! So you should explain that much in your question. More importantly, you're probably not talking about random fractions, like 15/27 or 3/7, and may not even need them to be very accurate, depending on the context. So please specify what fractions, exactly, you are considering, and how accurate they need to be, if at all.

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