erovira / transa-script

Shell script to compute the Itaú/BROU mean USD/UYU exchange rate
6 stars 2 forks source link

Mean is not being rounded properly #2

Closed erovira closed 2 years ago

erovira commented 2 years ago
➜  ~ transa 1000
Itaú compra y venta: 43.00, 44.75
(43.00 + 44.75) / 2 = 43.87
TRANSA: U$S 1000 = $ 43870.00

The mean is actually 43.875, which rounded should be 43.88 instead of 43.87.

What's more; the mean shouldn't be rounded at all. In any case, the final result should be rounded.