Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

SQL Reference

Functions

Syntax

Example

 

SQL Reference

Joins

Nested Queries

Set Operations

ON CURSOR | INSTANCE

WITH Options

Commands

Functions

 

$ROUND

The $ROUND function returns a numeric expression rounded to a specified number of decimal places.

If the value specified by n is positive and longer than the digits after the decimal point, 0 is added after the fraction digits.

If the value specified by n is negative and larger than or equal to the digits before the decimal point, 0.00 is returned.

 

Syntax

$ROUND(expression [,n])

expression
Required. A valid numerical value. This can be a column in a select statement that will return a numerical value.

n
Optional. n is an integer indicating the number of digits to the right of the decimal. The default is 0.

 

Example

$ROUND(123.4545, 2)  result: 123.4500

$ROUND(123.4545, -2) result: 100.0000

$ROUND(123.9994, 3)  result: 123.9990

$ROUND(123.9995, 3)  result: 124.0000


Top