Login     Register

        Contact Us     Search

XLeratorDB/math Documentation

SQL Server ROUNDDOWN function


ROUNDDOWN
 
Updated: 17 August 2010
Use ROUNDDOWN to calculate a number rounded down, towards zero.
Syntax
SELECT [westclintech].[wct].[ROUNDDOWN] (
   <@Number, float,>
 ,<@Num_digits, float,>)
Arguments
@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
@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
Return Types
float
Remarks
·         ROUNDDOWN behaves like the ROUND fucntion, 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
 
Example
 
SELECT wct.ROUNDDOWN(cast(2.0000 as float)/cast(3.0000 as float), 5)
Here is the result set
----------------------
0.66666
 
(1 row(s) affected)


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service