Round Functions
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
what does it mean when we say "Round up to the next integer" , "Round down to the next integer" , "Rounds to the nearest multiple decided by designer", "Rounds to the nearest multiple specified".
To be more clear, how can we know when to use CEIL(X), FLOOR(X), SMARTROUND(X), ROUND(X, MUL)
- Labels:
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can find those formula expressions, their meanings, and some examples here: https://help.alteryx.com/20223/designer/math-functions
Some examples:
CEIL(x) should be used when when you want to return the nearest highest integer. If you want to avoid using pennies in your prices and your product is priced at $4.42, use the CEIL(4.42) to round prices up to $5.
You can use ROUND(X,MUL) when you want specific decimal precision. Using the same example above, ROUND(4.42, .01) would keep my amount at 4.42, ROUND(4.42, .1) would round my amount to 4.40. ROUND(4.42, 1) would return 4, which is different from CEIL(4.42).
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Sreedhar_2798 ,
Those functions differ in the logic used to find the rounded value. For most purposes, using CEIL, FLOOR, or ROUND are sufficient.
Here is a small description of them:
RoundUP: To always round up (away from zero), use the ROUNDUP function
RoundDown: This can be useful for formatting numbers or when you need to calculate a percentage of a whole number. For example, if you have a list of numbers and you want to round them all down to the nearest hundred, you can use the ROUNDDOWN function in a formula like this: =ROUNDDOWN(A2,100)
SMARTROUND(x): Return [x] rounded to nearest multiple of a value determined dynamically based on the size of [x]
Round: We can use the ROUND function for rounding to the right or left of the decimal point. If num_digits is greater than 0, the number will be rounded to the specified decimal places to the right of the decimal point.
