Skip to content

Commit f56adaa

Browse files
committed
Merge rounding functions into mathematical functions page
1 parent d5bb760 commit f56adaa

File tree

4 files changed

+59
-71
lines changed

4 files changed

+59
-71
lines changed

src/content/docs/analytics/analytics-engine/sql-reference/mathematical-functions.mdx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,60 @@ Examples:
5454
-- get the square of the double1 column
5555
pow(double1, 2)
5656
```
57+
58+
## round <Badge text="New" variant="tip" size="small" />
59+
60+
Usage:
61+
62+
```sql
63+
round(<expression>[, n])
64+
```
65+
66+
`round` returns a number rounded to the nearest whole number, or to a given number of decimal points specified by the second argument.
67+
68+
Examples:
69+
70+
```sql
71+
-- round 5.5 to 6
72+
round(5.5)
73+
-- round 3.14 to 3.1
74+
round(3.14, 1)
75+
```
76+
77+
## floor <Badge text="New" variant="tip" size="small" />
78+
79+
Usage:
80+
81+
```sql
82+
floor(<expression>[, n])
83+
```
84+
85+
`floor` returns a number rounded down to a whole number, or rounded down to a given number of decimal points specified by the second argument.
86+
87+
Examples:
88+
89+
```sql
90+
-- round down 5.5 to 5
91+
floor(5.5)
92+
-- round down 3.14 to 3.1
93+
floor(3.14, 1)
94+
```
95+
96+
## ceil <Badge text="New" variant="tip" size="small" />
97+
98+
Usage:
99+
100+
```sql
101+
ceil(<expression>[, n])
102+
```
103+
104+
`ceil` returns a number rounded up to a whole number, or rounded up to a given number of decimal points specified by the second argument.
105+
106+
Examples:
107+
108+
```sql
109+
-- round up 5.5 to 6
110+
ceil(5.5)
111+
-- round up 3.14 to 3.2
112+
ceil(3.14, 1)
113+
```

src/content/docs/analytics/analytics-engine/sql-reference/rounding-functions.mdx

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/content/docs/analytics/analytics-engine/sql-reference/string-functions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: String functions
33
pcx_content_type: reference
44
sidebar:
5-
order: 11
5+
order: 10
66
head:
77
- tag: title
88
content: SQL Reference

src/content/docs/analytics/analytics-engine/sql-reference/type-conversion-functions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Type conversion functions
33
pcx_content_type: reference
44
sidebar:
5-
order: 12
5+
order: 11
66
head:
77
- tag: title
88
content: SQL Reference

0 commit comments

Comments
 (0)