Well. It is not that easy to go from decimal to fraction. Because 1/2 = 0.5 = 2/4 = 4/8, etc. So if you have 0.5 how do you know which fraction is the correct one?
But what you could do is:
lnCnt = 0
lnDec = 0.6
do while .T.
lnCnt = lnCnt + 1
lnResult = lnCnt * lnDec
if lnResult == int(lnResult)
exit
endif
enddo
? "Fraction: " + allt(str(lnResult))+"/"+allt(str(lnCnt))
That should give you the first fraction met.
HTH,
- Erik Niese-Petersen
Crazy Dane in USA.