# Reporting: Rounding Numeric Values Prior to Calculations

**URL:** <https://forum.inductiveautomation.com/t/reporting-rounding-numeric-values-prior-to-calculations/14500>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [June 12, 2017, 5:35pm UTC](https://forum.inductiveautomation.com/t/reporting-rounding-numeric-values-prior-to-calculations/14500 "2017-06-12T17:35:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![caitlinf](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@caitlinf](https://forum.inductiveautomation.com/u/caitlinf)\
**Post date:** [June 12, 2017, 5:35pm UTC](https://forum.inductiveautomation.com/t/reporting-rounding-numeric-values-prior-to-calculations/14500/1 "2017-06-12T17:35:33Z")

</div>

Hello again,

I was adding up some numbers in my report and noticed something was a bit off. It seems that all rounding (in the form of number formats) is done after calculations are performed, leading to discrepancies such as this:

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2b455dbeda9693b3f997ab317c8242d7ec2b591b.JPG)

The total amount due here is one cent less than it should be. The key calculations I’m using to calculate these values are:  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/672448aa76604e70f318418793d829f0969d3623.JPG)

I know this must be due to the fact that “HST” is actually calculated as 374.4091 rather than 374.41 and FuelTax being calculated as 70.2455 rather than 70.25.

After looking through the reporting manual however, I can only find the function “round(float)” which is described as rounding to the nearest whole number.

Is there a way I can round to two decimal places before doing calculations?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 12, 2017, 6:02pm UTC](https://forum.inductiveautomation.com/t/reporting-rounding-numeric-values-prior-to-calculations/14500/2 "2017-06-12T18:02:33Z")

</div>

I’d suggest either doing the calculations in a scripting datasource, or else use/abuse multiplying and dividing by 100 so that you can take advantage of the `round()` keychain function

---

<div class="post-metadata">

**Author:** ![caitlinf](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@caitlinf](https://forum.inductiveautomation.com/u/caitlinf)\
**Post date:** [June 13, 2017, 1:13pm UTC](https://forum.inductiveautomation.com/t/reporting-rounding-numeric-values-prior-to-calculations/14500/3 "2017-06-13T13:13:31Z")

</div>

Multiplying/dividing by 100 and using the round() function worked out well, since I didn’t have to change too much. Thanks! 🙂
