Skip to content

functions_rounding_decimal.yaml

This document file is generated for functions_rounding_decimal.yaml

Scalar Functions

ceil

Implementations:
ceil(x): -> return_type
0. ceil(decimal<P,S>): ->

integral_least_num_digits = P - S + 1
precision = min(integral_least_num_digits, 38)
decimal?<precision, 0>  

*Rounding to the ceiling of the value x. *

floor

Implementations:
floor(x): -> return_type
0. floor(decimal<P,S>): ->

integral_least_num_digits = P - S + 1
precision = min(integral_least_num_digits, 38)
decimal?<precision, 0>  

*Rounding to the floor of the value x. *

round

Implementations:
round(x, s, option:rounding): -> return_type

  • x: Numerical expression to be rounded.
  • s: Number of decimal places to be rounded to. When `s` is a positive number, the rounding is performed to a `s` number of decimal places. When `s` is a negative number, the rounding is performed to the left side of the decimal point as specified by `s`. The precision of the resultant decimal type is one more than the precision of the input decimal type to allow for numbers that round up or down to the next decimal magnitude. E.g. `round(9.9, 0)` -> `10.0`. The scale of the resultant decimal type cannot be larger than the scale of the input decimal type.
  • 0. round(decimal<P,S>, i32, option:rounding): ->

    precision = min(P + 1, 38)
    decimal?<precision, S>  
    

    *Rounding the value x to s decimal places. *

    Options:
  • rounding ['TIE_TO_EVEN', 'TIE_AWAY_FROM_ZERO', 'TRUNCATE', 'CEILING', 'FLOOR', 'AWAY_FROM_ZERO', 'TIE_DOWN', 'TIE_UP', 'TIE_TOWARDS_ZERO', 'TIE_TO_ODD']