Logo

DOLLARDE

Updated 2023-10-12 14:44:50.153000

Syntax

SELECT [westclintech].[wct].[DOLLARDE] (
  <@Fractional_dollar, float,>
 ,<@Fraction, int,>)

Description

Use the scalar function DOLLARDE to convert a dollar price, expressed as a fraction, into a dollar price, expressed as a decimal number.

Arguments

@Fraction

the integer to be used as the denominator in converting the fraction. @Fraction is an expression of type int or of a type that can be implicitly converted to int.

@Fractional_dollar

the implicit fraction to be converted. @Fractional_dollar is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

If @Fraction is less than zero, an error will be returned,

If @Fraction is equal to a zero, a divide by zero error will be returned,

Examples

SELECT wct.DOLLARDE(1.59, 64);

Here is the result set.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1.921875"}]}

See Also

DOLLARFR - Calculate a dollar price, expressed as a decimal number, into a dollar price, expressed as a fraction.