in reply to Convert feet to feet+inches+fraction

It's a great function, but as with any decimal-to-floating-to-fraction code, the question will be how stable all possible conversions are. On what architectures will 1/8" really be encoded into something messy like 0.1249999302"?

--
[ e d @ h a l l e y . c c ]

  • Comment on Re: Convert feet to feet+inches+fraction

Replies are listed 'Best First'.
Re^2: Convert feet to feet+inches+fraction (round)
by tye (Sage) on Sep 02, 2003 at 19:18 UTC

    That isn't be a problem. My code rounds and has you specify the level of accuracy you want reported. Try ft2str( 0.9/12/8, 8 ) and you'll get 0 1/8".

                    - tye