# Resource Distribution Rounding Behavior

• If a user enters a number that does not divide equally, the system rounds up or down the resources applied to the first task processed to equal the usage, hours, quantity, and cost amount the user entered.
• The rounded portion goes to the same Task for the entire Distribute Resource screen. For example,  1 gallon of paint is used on 3 Tasks.  Task 1 gets .34 and Task 2 and 3 get .33 gallons.
• The system does not try to divide the quantity and the cost on a material.  It uses the system formula of Qty*PpU=Cost.  The Quantity is equally divided and the formula calculates costs.

## Precision Loss Caused by Rounding

When resources are distributed to a large number of tasks, because rounding happens to two places after the decimal point, precision can be lost. When this happens Cartegraph implements an alternative rounding behavior of rounding down instead of up.

### Example

This example shows how Cartegraph checks rounding behavior results to keep data precision. For this example 500 Tasks are selected, 8 Labor hours entered, resulting in 0.01 hours per task.

1. The system first uses rounding up behavior:
2. 8 hours/500 tasks = 0.016 and is rounded up to 0.02
3. 0.02 is multiplied by 499 = 9.98
 NOTE: 499 is used because 1 task is reserved to receive the adjusted amount to keep precision.
1. 9.98 is subtracted from 8 hours creating a negative number and an inaccurate results caused by rounding up.
2. The system detects this situation and recalculates using rounding down behavior called flooring.
3. 8 hours/500 = 0.016 and is rounded down to 0.01.
4. 0.01 is multiplied by 499 = 4.99
5. 4.99 is subtracted from 8 hours = 3.01
6. 3.01 is applied to the reserved task to keep data precision.