Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> conveting decimal to a fraction.

conveting decimal to a fraction.

From: <siddsoni_at_hotmail.com>
Date: Thu, 12 Aug 1999 19:49:54 GMT
Message-ID: <7ov8gu$k52$1@nnrp1.deja.com>


Is there an easy way to convert, say 1.75 to display as "1 3/4"

I know I can multiply by 10 until its a whole number. and then take the GCD of:
175 and (10^num_times_multiplied)

175/100 = 7/4
then use mod and div to concat a string of the fraction

Thanks for any help
Or post the code if youve already got it.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Aug 12 1999 - 14:49:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US