Logo

DOLLARFR

Updated 2023-10-12 14:46:29.270000

Syntax

SELECT [westclintech].[wct].[DOLLARFR] (
  <@Decimal_dollar, float,>
 ,<@Fraction, int,>)

Description

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

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.

@Decimal_dollar

the decimal number to be converted. @Decimal_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.DOLLARFR(1.921875, 64);

Here is the result set.

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

See Also

DOLLARDE - Dollar - fraction to Decimal