3 Answers
- Newest
- Most votes
- Most comments
1
Hi, it depends on what specifically do you want, with a similar example 0.6456524 and 3 decimals
- If you want to have a ceiling of the previous decimal value : 0.646 To do this you can use a UDF or this mathematic expression
CEIL((CAST(column1 AS double) / column2)*1000)/1000 as cvr
- if you want to have a floor of the previous decimal value : 0.645
FLOOR((CAST(column1 AS double) / column2)*1000)/1000 as cvr
- if you want to numerically round the previous decimal value : 0.646. To do this you can use
ROUND((CAST(column1 AS double) / column2), 3) as cvr
You can always refer to the Athena operations documentation here
answered 2 years ago
0
You can use ROUND(col, 3)
to round a number to three decimal points:
SELECT ROUND(CAST(column1 AS DOUBLE) / column2), 3) AS cvr
FROM my_table
answered 2 years ago
Relevant content
- asked 2 years ago
- asked 2 years ago
- How do I use the Microsoft KB number in Patch Manager to install a specific patch or set of patches?AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago