Function round()
calculates the nearest value of a given number, corrected to a designated position of digit; when two nearest values are found, returns the one with larger absolute value.
Arguments:
- Number <number>
- Position of digit <integer>,-1 for '10', 0 (default) for '1', 1 for '0.1', and so on
Returns:
- Round <number>
If the number and the position of digit are non-homologous, Cartesian Product will be applied when the function is called in a WITH clause, or column length will be trimmed when called in a RETURN clause.
Common Usage
Example: round -25.5 with 1 decimal place
return round(-25.5)
Example (V4.1): find 10 cards whose balances are over 500,000, round their balance to -4 decimal place
find().nodes({@card.balance >= 500000}) as n
limit 10
return round(n.balance, -4)