Converts a decimal price to a fractional price.

Namespace: Imsl.Finance
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0

Syntax

C#
public static double Dollarfr(
	double decimalDollar,
	int fraction
)
Visual Basic (Declaration)
Public Shared Function Dollarfr ( _
	decimalDollar As Double, _
	fraction As Integer _
) As Double
Visual C++
public:
static double Dollarfr(
	double decimalDollar, 
	int fraction
)

Parameters

decimalDollar
Type: System..::.Double
A double which specifies a decimal number.
fraction
Type: System..::.Int32
A int which specifies the denominator.

Return Value

A double which specifies a dollar price expressed as a fraction.

Remarks

It is computed using the following:

{\it idollar} + {{{\it decimalDollar} - 
            {\it idollar}} \over {10^{\left( {{\it ifrac} + 1} \right)} / 
            {\it fraction}}}

where {\it idollar} is the integer part of the {\it decimalDollar}, and {\it ifrac} is the integer part of log({\it fraction}).

See Also