QUOTE(guy3288 @ Apr 11 2024, 11:32 PM)
How to round it up if next decimal is less than 5?
I give few numbers below awaiting for round up from whoever can confirm it
0.0445
0.1247
0.3449
0.4550
any one can confirm all would be rounded up to 0.05, 0.13, 0.35 and 0.46?
i think only 0.46 can happen, the rests would be rounded down.
The Raya 2% was incorrectly done because GXbank has rounded up wrongly
something that should be rounded down..
Rounded would be like this. Old school behaviour.
0.0445 -> 0.04
0.1247 -> 0.12
0.3449 -> 0.34
0.4550 -> 0.46
It can be more complicated. For example, in Swift, round can have different behaviours: awayFromZero, toNearestOrAwayFromZero, toNearestOrEven, towardZero, down, up or just old school round (which is toNearestOrAwayFromZero).
As far as GXB is concerned, I've tested that 0.005 rounds to 0.01. RM61 @ 3% gives 1 sen interest. (0.005000000000015) This is with at least a precision of 15 decimal points.
14 decimal points will get 0 sen. (0.00499999981)
Then you're back to 1 sen at 8 decimal points precision. (0.00500017)

The 3% is incorrect. The Raya 2% was incorrectly done because of the 3%.
This post has been edited by soonwai: Apr 12 2024, 12:27 AM