(42) Feet inches fractions
|
07-11-2021, 08:31 PM
(This post was last modified: 06-22-2022 06:43 PM by DMaier.)
Post: #1
|
|||
|
|||
(42) Feet inches fractions
This code takes decimal inches, e.g., 14.25 in X and returns the following in Alpha:
The maximum denominator, which should be a power of 2, is assumed to be set in variable DEN (store 16 in DEN if you don't want anything smaller than sixteenths, for example). Note that the code rounds to the nearest fraction. The code uses flag 82 internally and doesn't preserve the stack (but see suggested modification in comments). EDIT (2022-06-22): Updated to remove a serious bug in handling non-integer values that rounded to integers. Sample output (DEN=8, flag 1 clear): Code:
Code:
|
|||
06-22-2022, 07:47 PM
Post: #2
|
|||
|
|||
RE: (42) Feet inches fractions
For anyone aspiring to pursue the lucrative construction calculator market, here's a fancier version targeting Plus42 (remove the units conversion code in lines 25 to 32 for Free42).
This version uses two variables (both of which will be created and set to default values if not specified by the user):
In addition:
Code:
Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)