Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> conveting decimal to a fraction.
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