# HP Forums

Full Version: (42S) Convert Decimal to Tape Measure Fractions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Video demonstration here:

Program code and raw file (for Free42) can be found here:
https://goo.gl/03Tj59

The program takes a decimal input (which the user can produce using the help of the interface) and then converts it to the precision specified by the user.

I won't say its perfect, and perhaps it duplicates some other program out there (I couldn't find it if there is one) and I welcome any feedback as this is one of my first programming attempts.
(09-16-2016 02:28 PM)Logan Wrote: [ -> ]I won't say its perfect, and perhaps it duplicates some other program out there (I couldn't find it if there is one) and I welcome any feedback as this is one of my first programming attempts.

Using the menu 42s system sure is a nice feature. As far as the conversion itself is concerned: this has been discussed here before, the last time in January in this thread for the 41-series. Maybe the underlying algorithm can be useful.

Dieter
Thank you! Those definitely give me some ideas and defaulting to a 16th as the precision seems good enough for most purposes and that will trim things down a bit.

I was trying to avoid changing the display mode, though that would have simplified things I know.
(09-16-2016 06:42 PM)Logan Wrote: [ -> ]Thank you! Those definitely give me some ideas and defaulting to a 16th as the precision seems good enough for most purposes and that will trim things down a bit.

The linked program allows the user to set the precision he prefers. 1/8 is just as fine as 1/64. If possible (and set by the user) the program reduces the resulting fraction to the one with the least denominator.

(09-16-2016 06:42 PM)Logan Wrote: [ -> ]I was trying to avoid changing the display mode, though that would have simplified things I know.

On the 41 (C/CV) there is no AIP command that appends the integer portion to Alpha. So ARCL has to be used and the display mode is set to FIX 4 without radix mark (flag 29). On the 42s you can of course use AIP (and a few stack exchange commands as AIP only works with X).

Maybe you have also seen the discussion on using RCL d/STO d on the 41. This synthetic 41 command saves all flag settings (not only those for the display) resp. restores them later.

Dieter
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :