IFinance.DollarFr

Fore Syntax

DollarFr(DecimalValue: Double; Fraction: Integer): Double;

Fore.NET Syntax

DollarFr(DecimalValue: double; Fraction: integer): double;

Parameters

Parameters Description Constraints
DecimalValue The number consisting of integer and fractional parts separated with decimal separator. Greater or equal to 0.
Fraction An integer, which has to be used as a denominator. Not equal to 0.

Description

The DollarFr method is used to convert a ruble price expressed as a decimal number to a ruble price expressed as a fraction.

Comments

DollarFr is calculated using the following formula:

DollarFr = FV + Value × (0.1k × Fraction),

where:

Fore Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r: Double;
Begin
    r := Finance.DollarFr(1.12516);
    Debug.WriteLine(r);
End Sub UserProc;

After executing the example the console window displays the transformation equal to 1.02. The example transforms the decimal number 1.125 into the number read as 1 integer and 2/16 and written as 1.02.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.MathFin;

Public Shared Sub Main(Params: StartParams);
Var
    r: double;
    Finance: FinanceClass = New FinanceClass();
Begin
    r := Finance.DollarFr(1.125, 16);
    System.Diagnostics.Debug.WriteLine(r);
End Sub;

See also:

IFinance