Subject | rounding in IB 5.6 (Sco) with perl |
---|---|
Author | Bill Katelis |
Post date | 2001-09-04T06:18:10Z |
Hi,
I have a field in the db which is numeric(15,2)
When I sum in isql I get:
SUM
======================
1858.7500
Field values are as follows:
COIN
======================
222.25
333.33
444.55
666.66
111.11
0.00
0.00
80.85
When I extract using perl and add the values I get: 1858.74
Why?
Should I be rounding before adding as a previous post suggests?
If so, does anyone know how to round to 2 decimal places in perl (apart
from sprintf)
thanks
bill
[Non-text portions of this message have been removed]
I have a field in the db which is numeric(15,2)
When I sum in isql I get:
SUM
======================
1858.7500
Field values are as follows:
COIN
======================
222.25
333.33
444.55
666.66
111.11
0.00
0.00
80.85
When I extract using perl and add the values I get: 1858.74
Why?
Should I be rounding before adding as a previous post suggests?
If so, does anyone know how to round to 2 decimal places in perl (apart
from sprintf)
thanks
bill
[Non-text portions of this message have been removed]