Logo

ROUNDDOWN

Updated 2023-10-20 15:31:49.910000

Syntax

SELECT [westclintech].[wct].[ROUNDDOWN] (
   <@Number, float,>
 ,<@Num_digits, float,>)

Description

Use the scalar function ROUNDDOWN to calculate a number rounded down, towards zero.

Arguments

@Num_digits

is the number of digits to be rounded down to. @Num_digits is an expression of type float or of a type that can be implicitly converted to float.

@Number

is the number to rounded down. @Number is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

ROUNDDOWN behaves like the ROUND function, except that it always rounds @Number down, towards zero.

If @Num_digits is greater than 0 (zero), then number is rounded down to the specified number of decimal places.

If @Num_digits is 0, then number is rounded down to the nearest integer.

If @Num_digits is less than 0, then number is rounded down to the left of the decimal point.

Rounding down means towards zero.

Examples

SELECT wct.ROUNDDOWN(cast(2.0000 as float) / cast(3.0000 as float), 5);

Here is the result set.

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