ROUND

<< Click to Display Table of Contents >>

 

ROUND

Returns the numeric value indicated in the @value parameter rounded, according to the configuration specified in the @length and @mode parameters. The data type of the returned value is the same as the @value parameter.

 

Syntax

ROUND(@value, @length[, @mode])

 

Parameters

@value: Numeric value to round up. This is a mandatory parameter

@length: Value indicating the order of magnitude, or precision, for which the @value parameter is rounded up. A value of 0 (zero) represents rounding up to integer values. Positive values indicate rounding up to decimal places. A value of 1 (one) for tenths, 2 (two) for hundredths, and so on. Negative values indicate rounding up to a certain power of 10. A value of -1 (minus one) for tenths, -2 (minus two) for hundredths, and so on. This is a mandatory parameter

@mode: Optional parameter indicating what rounding up method must be used. When omitted, or used with a value of 0 (zero, default), this function rounds up to the nearest value with a precision determined by the @length parameter. When using any other value, this function returns the value indicated in the @value parameter truncated to the precision determined by the @length parameter

Was this page useful?