Decimals to fraction strings

Darrell Gallion darrell at dorb.com
Wed May 17 00:02:34 EDT 2000


Check out http://www.dorb.com/darrell/numberTheory/numberTheory.py

--Darrell Gallion

"Scott" <kain at cableadmin.com> wrote in message news:slrn8i1cv1.8mf.kain at cableadmin.com...
> Hi,
> 
> Does anyone know of a way to convert decimal numbers to a string 
> representation of the fractional value? For example:
> 0.5 = "1/2"
> or
> 1.125 = "1 1/8"
> 
> Thanks,
> Scott
> 
> -- 
> http://www.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20000516/8b7e427f/attachment.html>


More information about the Python-list mailing list