Not mine and I haven't tried it but here you go.

Public Function DecToFraction(ByVal l_fDecimal As Double) As String

   Dim l_dQuotient As Double
   Dim l_lNumerator As Long
   Dim l_lDenominator As Long
   
   l_lNumerator = 1
   l_lDenominator = 1
   
   l_dQuotient = l_lNumerator / l_lDenominator
   While (l_dQuotient <> l_fDecimal)
      If (l_dQuotient < l_fDecimal) Then
         l_lNumerator = l_lNumerator + 1
      Else
         l_lDenominator = l_lDenominator + 1
         l_lNumerator = l_fDecimal * l_lDenominator
      End If
      l_dQuotient = l_lNumerator / l_lDenominator
   Wend
DecToFraction = CStr(l_lNumerator) & "/" & CStr(l_lDenominator)
If l_lNumerator = 0 Then DecToFraction = ""
End Function

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.691 / Virus Database: 452 - Release Date: 5/26/2004
 


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/k7folB/TM
--------------------------------------------------------------------~-> 


'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [EMAIL PROTECTED]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to