Skip to content

Latest commit

 

History

History
158 lines (114 loc) · 3.5 KB

File metadata and controls

158 lines (114 loc) · 3.5 KB
description
Returns the rounded value for the inputted value. If no scale is specified, the closest whole number is returned.

ROUND

Syntax

ROUND(numeric_expression decimal(0,0), scale int32) → decimal(0,0)

  • numeric_expression: Numeric value to round.
  • scale: The decimal place to round.

Examples

{% code title="ROUND example" %}

SELECT ROUND(-24.35, -1)
-- -24.4

{% endcode %}

{% code title="ROUND example" %}

SELECT ROUND(24.35, 1)
-- 24.4

{% endcode %}

ROUND(numeric_expression int32, scale int32) → int32

  • numeric_expression: Numeric value to round.
  • scale: The decimal place to round.

Examples

{% code title="ROUND example" %}

SELECT ROUND(24, 0)
-- 0

{% endcode %}

{% code title="ROUND example" %}

SELECT ROUND(-24, -1)
-- -20

{% endcode %}

ROUND(numeric_expression int32) → int32

  • numeric_expression: Numeric value to round.

Examples

{% code title="ROUND example" %}

SELECT ROUND(24)
-- 24

{% endcode %}

ROUND(numeric_expression double) → double

  • numeric_expression: Numeric value to round.

Examples

{% code title="ROUND example" %}

SELECT ROUND(24.35)
-- 24

{% endcode %}

ROUND(inputHolder decimal(0,0)) → decimal(0,0)

  • inputHolder: sample parameter description

Examples

{% code title="ROUND example" %}

sample call 1
-- sample return 1

{% endcode %}

ROUND(in float) → float

  • in: sample parameter description

Examples

{% code title="ROUND example" %}

sample call 1
-- sample return 1

{% endcode %}

ROUND(in int64) → int64

  • in: sample parameter description

Examples

{% code title="ROUND example" %}

sample call 1
-- sample return 1

{% endcode %}

ROUND(input1 int64, input2 int32) → int64

  • input1: sample parameter description
  • input2: sample parameter description

Examples

{% code title="ROUND example" %}

sample call 1
-- sample return 1

{% endcode %}

ROUND(input1 double, input2 int32) → double

  • input1: sample parameter description
  • input2: sample parameter description

Examples

{% code title="ROUND example" %}

sample call 1
-- sample return 1

{% endcode %}

ROUND(numeric_expression float, input2 int32) → float

  • numeric_expression: sample parameter description
  • input2: sample parameter description

Examples

{% code title="ROUND example" %}

sample call 1
-- sample return 1

{% endcode %}