<-- Previous || Up || Next -->

Rational To Fraction String Function
Math Arithmetic Class

Public Function RationalToFractionString( _
    ByVal vRational As Variant _
    ) As Variant

"Rational Number To Fraction String"
Converts vRational to X+Y/Z (where X, Y, and X are all integers) then returns that algebraic expression as a string.

Examples:
    RationalToFractionString(2.4) = "2+2/5"
    RationalToFractionString(43.75) = "43+3/4"
    RationalToFractionString(-43.75) = "-43-3/4"
    RationalToFractionString(-43) = "-43"
See also:
    RationalToFraction Function
    FloatToFraction Function
vRational: The number which is separated into its integer, fractional dividend, and fractional divisor parts. Function returns Null if vRational is Null or cannot be fixed up to a number. Note: When vRational is positive, the fraction will be of the form "X+Y/Z" and when vRational negative, the fraction will be of the form "-X-Y/Z". (When vRational is negative, the dividend will always be negative and the divisor will always be positive.)

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.