rnd()

Function group Execute on client Platform(s)
Number YES All

Syntax

rnd(number,dp)

Description

Rounds a number to a number of decimal places specified in dp and returns the result.

Note that the return value of rnd() is a character string. This is the only representation of the returned number guaranteed to hold the result correctly, due to potential floating point inaccuracies.

You need to be careful when comparing the return values of two calls to rnd(), since the return values are character strings, and will be compared as strings.

Example

Calculate lResult as rnd(2.105693,5)
; returns 2.10569


Calculate lResult as rnd(2.105693,3)
; returns 2.106


Calculate lResult as rnd(0.5,0)
; returns 1