Login     Register

        Contact Us     Search

XLeratorDB/math Documentation

SQL Server CEILING function


CEILING
 
Updated: 17 August 2010
Use CEILING to calculate a number rounded up, away from zero, to the nearest multiple of significance. For example, it you are dealing with a currency for which there are no fractional units, the formula CEILING(100.1, 1) would return 101.
Syntax
SELECT [westclintech].[wct].[CEILING] (
   <@Number, float,>
 ,<@Significance, float,>)
Arguments
@Number
is the value to be round up, away from zero. @Number is an expression of type float or of a type that can be implicitly converted to float
@Significance
is the multiple to which you want to round. @Significance is an expression of type float or of a type that can be implicitly converted to float
 
Return Types
float
Remarks
·         The sign of @Number and @Significance must be the same
·         The term rounding up always means rounding away from zero
Example
 
SELECT wct.CEILING(100.1, 1)
Here is the result set
----------------------
101
 

(1 row(s) affected)



Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service