Working with Data: All the calculations you need t
  • Introduction
  • What is this book?
  • How to Use this Book
  • Document Notes
  • Authors' Thanks
  • Strings
    • Concatenate
    • Split
    • Length
    • Slice
    • Trim
    • Contains
    • Match
    • Replace
    • Upper/Lower Case
  • Numbers
    • Sum
    • Average
    • Roll Ups
    • Round
    • Floor
    • Power
    • Square Root
    • Absolute
  • Dates
    • Date Difference
    • Age
  • Logical
    • Logical Operators
    • If
    • Case / Switch
    • Is Null/Empty
  • General
    • Count
    • Filter
    • Sort
    • Lookup/Join
    • Variables
    • Convert Type
  • Appendix
    • DateTime Parts
    • Helpful Resources
Powered by GitBook
On this page
  • Excel
  • Tableau
  • Alteryx
  • OrgVue
  • tSQL
  • Python

Was this helpful?

  1. Numbers

Round

PreviousRoll UpsNextFloor

Last updated 5 years ago

Was this helpful?

Excel

=~ROUND!~(‹number›, ‹decimals›)

=ROUND(A1,3)

=ROUND(3.14159,2) // Returns 3.14

NB. To round to the nearest integer, set ‹decimals› to 0.

You can also force Excel to round up or down (similar to a function) using:

  • =~ROUNDUP!~(‹number›, ‹decimals›) or

  • =~ROUNDDOWN!~(‹number›, ‹decimals›)

=ROUNDUP(2.7182,3) // Returns 2.719
=ROUNDDOWN(2.7182,3) // Returns 2.718

Tableau

~ROUND!~(‹measure›, ‹decimals›)

ROUND([Cost],2)

ROUND(3.14159,2) // Returns 3.14

NB. To round to the nearest integer, set ‹decimals› to 0.

Alteryx

~ROUND!~(‹measure›, ‹decimals›)

ROUND([Cost],2)

ROUND(3.14159,2) // Returns 3.14

NB. To round to the nearest integer, set ‹decimals› to 0.

OrgVue

node.‹measure›.value.~format!~(«'formatting'»); OR ‹measure›.~round!~(«decimals»);

node.salary.format('000') // 8004.34 -> 80.0K
node.cost.round(2)

NB. Omitting the number of decimals automatically rounds the value to 0dp. ~Math.round!~(‹measure›) is also available but it does not allow you to specify the number of decimals.

tSQL

~ROUND!~(‹field›, ‹decimals›)

SELECT ROUND(Cost,2) 
FROM OrdersData

Python

~round!~(‹measure›«, decimals»)

round(cost)

round(math.pi,2) 
# Returns 3.14 assuming the math library has been imported

NB.:

  • Omit «decimals» to round to the nearest integer.

The above example assumes a variable has been declared for cost and that the math library has deen installed (import math). For more information, go to .

Floor
General > Variables