Login     Register

        Contact Us     Search

XLeratorDB/math Documentation

SQL Server ROUNDUP function


ROUNDUP
 
Updated: 17 August 2010 
Use ROUNDUP to calculate a number rounded up, away from zero.
Syntax
SELECT [westclintech].[wct].[ROUNDUP] (
   <@Number, float,>
 ,<@Num_digits, float,>)
Arguments
@Number
is the number to rounded up. @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 up to. @Num_digits is an expression of type float or of a type that can be implicitly converted to float
Return Types
float
Remarks
·         ROUNDUP behaves like the ROUND fucntion, except that it always rounds @Number up, away from zero.
·         If @Num_digits is greater than 0 (zero), then number is rounded up to the specified number of decimal places.
·         If @Num_digits is 0, then number is rounded up to the nearest integer.
·         If @Num_digits is less than 0, then number is rounded up to the left of the decimal point.
·         Rounding up means away from zero
 
Example
 
SELECT wct.ROUNDUP(cast(2.0000 as float)/cast(3.0000 as float), 5)
Here is the result set
----------------------
0.66667
 
(1 row(s) affected)


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service