Types of Rounding Rules
Create different types of rounding rules.
-
Round to precision
-
Round to nearest
-
Round to the nearest multiple
-
Round to range
The Standard direction rounds up or down to the nearest value for each of these types. For example, if the value is $1.75, then round up to $2. If the value is $1.25, then round down to $1.
Round to Precision
Here are some examples where Round To specifies to round according to a decimal place value.
Price |
Round To |
Direction |
Rounded Value |
---|---|---|---|
$15.75 |
0 |
Up |
$16.00 |
$15.75 |
0 |
Down |
$15.00 |
$15.75 |
0 |
Standard |
$16.00 |
$187.5 |
0 |
Standard |
$188.00 |
$187.57 |
1 |
Standard |
$187.60 |
$187.587 |
2 |
Standard |
$187.59 |
Consider a few examples.
-
The price in the first row of the table is $15.75. Round To equals 0, which means we will round to 0 decimal places. The Direction is Up, so we round the value 15.75 up to the nearest value that doesn't have any decimal values, and that value is 16.
-
The price in the last row is $187.587. Round To equals 2, which means we will round to 2 decimal places. The Direction is Standard, so we round up or down to the nearest the value in the second decimal place. The value of the third decimal place in 0.587 is 7, so we round 0.587 up to 0.59.
Round to precision actually means round to scale. Precision is the total number of digits that a number contains, where scale specifies the number of digits that exist to the right of the decimal point. For example, the number 123.45 uses a precision of 5 and a scale of 2. So if you set Round To to 2, you're actually not specifying precision. You're specifying to round the value to a scale that has two digits to the right of the decimal point.
Round to Nearest
Here are some examples that use round to nearest, where Round To specifies the value to use when rounding.
Price |
Round To |
Direction |
Incremental Value |
Rounded Value |
---|---|---|---|---|
$0.22 |
.05 |
Up |
0.10 |
$0.25 |
$0.22 |
.05 |
Down |
0.10 |
$0.15 |
$0.22 |
.05 |
Standard |
0.10 |
$0.25 |
$1.87 |
0.05 |
Up |
0.1 |
$1.95 |
$1.87 |
0.05 |
Down |
0.1 |
$1.85 |
$1.87 |
0.05 |
Standard |
0.1 |
$1.85 |
$198.67 |
0.05 |
Up |
0.1 |
$198.75 |
$198.67 |
0.05 |
Down |
0.1 |
$198.65 |
$198.67 |
0.05 |
Standard |
0.1 |
$198.65 |
Pricing adds the Increment Value according to the value that you set for Round To. Consider the first row in the table.
-
If Round To is 0.05, and if increment is 0.1, then the rounded values are 0.05, 0.15, 0.25, 0.35, 0.45 and so on.
-
The price starts at 0.22.
-
Round To is 0.05, which means to round the hundredth value to 5, so no matter what the direction or increment, the hundredth is going to be 0.05.
-
Direction is Up, and the increment is 0.10, so we're going to round the tenth up in increments of 0.10.
-
.22 rounded up to 0.05 equals 0.25. The equation doesn't add an increment because the price is already rounded to 0.25.
You can also manually modify the Increment Value. You can specify an increment of a whole, a tenth, a hundredth, or a whole multiple of a decimal, such as 0.5 or 0.25.
Round to the Nearest Multiple
Here are some examples that use round to the nearest multiple to round to the nearest multiple of the Round To value.
Price |
Round To |
Direction |
Rounded Value |
---|---|---|---|
$15.75 |
5 |
Up |
$20.00 |
$15.75 |
5 |
Down |
$15.00 |
$15.75 |
5 |
Standard |
$15.00 |
For example, if you set Round To to 5, then the multiples of Round To are 5, 10, 15, 20, and so on.
The first row in the table contains a price of 15.75 and a direction of Up. The nearest multiple of 15 when rounding up is 20.
Round to Range
Here are some examples that use round to range to round to a range of values that you specify.
Price |
Round Value |
Rounding Rule Type |
Rounded Value |
Direction |
Increment Value |
---|---|---|---|---|---|
$0 |
100 |
Round to nearest |
0.99 |
Standard |
1 |
$100 |
10,000 |
Round to nearest |
9 |
Standard |
10 |
$10,000 |
10,500 |
Round to value |
10,500 |
Standard |
Not applicable |
You can identify more than one range and set up a separate rounding rule for each range. Here are the round rule types you can use.
Rounding Rule Type |
Description |
---|---|
Round to precision |
Round to a precision. |
Round to nearest |
Round to the nearest value. |
Round to the nearest multiple |
Round to the nearest multiple of the value. |
Round to value |
Round to a fixed value. |
You can set only one rounding rule for each range of values.
You must create at lease one range.
-
Set the Type attribute to Round to Range on the Manage Rounding Rules page.
-
In the Ranges area, click Actions > Add Row.
-
Set the values for at least the Range From, Type, and Round To attributes.
-
Click Save.