General information
Category:
Coding, syntax & commands
Brian,
Off the top of my head, I'd say 1 / .25 = 4, which is your denominator. Divide 1 by your decimal and you get the denominator x in the expression 1/x.
For 2.25 (and other mixed numbers), use this approach:
1. Divide 1 by the decimal portion to get your denominator
2. multiply the denominator by the integer portion, add 1, that's your numerator.
>Has anyone ever seen a routine that will take a decimal number, and output a string that is formatted as a fraction. For instance, send in .25, and it will return "1/4". Any help would be great.
>
>Thanks
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only