We are rounding a formula based on an input parameter (decimal precision) from the main report, but it is not working. The decimal precision options are either 2 or 3 decimal places, so we are passing a 2 or 3.
We are passing this input parameter through to the subreport as Shared Numbervar DecimalPrecision.
I have created a formula in the subreport for a Local NumberVar DecimalPrecision1 and am making that equal to the Shared NumberVar DecimalPrecision that we've passed through from the main report.
I have a second formula in the subreport where we are multiplying a sell amount * tax amount. We then are rounding to the decimal precision passed through (in this case we are using our NumberVar DecimalPrecision1).
The result is that the formula is rounding to the nearest whole number, not to the nearest decimal precision.
We have also tried this, and we've gotten closer, but it will work rounding one way, but not the other.
In the formula where we multiply the sell amount * tax amount, that's all we do, we do not round.
We then format the formula field (customize) and conditionally (x-2) set the decimal places to NumberVar DecimalPrecision1. And, conditionally round (x-2) the field to NumberVar DecimalPrecision1.
The fields look okay in the subreport, but then when we add up the total tax, we are off by a penny.
We are adding up this formula field using a running total, and then formatting it the same way...to round and set decimal places conditionally based on NumberVar DecimalPrecision1.
It seems to work fine this way if we are calculating based on 3 decimal places.
However, when we are set to 2 decimal places, it seems like the formula is totalling the tax using 3 decimal places and then rounding. Thus we are off by a penny.
Example:
Tax Amount(3) Tax Amount(2)
7.243 7.24
4.564 4.56
Total Is: 11.807 11.81
Total Should Be: 11.807 11.80
Can anyone explain how I can get around this problem?
Thank you.
We are passing this input parameter through to the subreport as Shared Numbervar DecimalPrecision.
I have created a formula in the subreport for a Local NumberVar DecimalPrecision1 and am making that equal to the Shared NumberVar DecimalPrecision that we've passed through from the main report.
I have a second formula in the subreport where we are multiplying a sell amount * tax amount. We then are rounding to the decimal precision passed through (in this case we are using our NumberVar DecimalPrecision1).
The result is that the formula is rounding to the nearest whole number, not to the nearest decimal precision.
We have also tried this, and we've gotten closer, but it will work rounding one way, but not the other.
In the formula where we multiply the sell amount * tax amount, that's all we do, we do not round.
We then format the formula field (customize) and conditionally (x-2) set the decimal places to NumberVar DecimalPrecision1. And, conditionally round (x-2) the field to NumberVar DecimalPrecision1.
The fields look okay in the subreport, but then when we add up the total tax, we are off by a penny.
We are adding up this formula field using a running total, and then formatting it the same way...to round and set decimal places conditionally based on NumberVar DecimalPrecision1.
It seems to work fine this way if we are calculating based on 3 decimal places.
However, when we are set to 2 decimal places, it seems like the formula is totalling the tax using 3 decimal places and then rounding. Thus we are off by a penny.
Example:
Tax Amount(3) Tax Amount(2)
7.243 7.24
4.564 4.56
Total Is: 11.807 11.81
Total Should Be: 11.807 11.80
Can anyone explain how I can get around this problem?
Thank you.