× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ummm, questions, questions...

How many decimal places do you need to support?

Need to support negative numbers?

What does a repeating number come out as, for example .333?

On solution in the Oracle thread was to create a table that contained the decimal plus the corresponding numerator and denominator. So supporting 3 decimals you would have 999 entries. Example entries might be
.250,1,4, or
.750,3,4 or
.375,3,8

This seems to be to be reasonably efficient, but maybe not workable if you have to support many different decimal places.

Interesting math and analysis in the Oracle thread. Probably could be done in RPG.

Sam


On 12/21/2016 11:00 AM, Gerald Magnuson wrote:
I am looking for a sql function that would turn a decimal number to a
fraction.

I found the following, for ORACLE... and tried to make it work for DB2 for
i...
but I am not nearly capable for that...
https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:410098200346123548



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.