I need to do a calculation that takes currency amounts and rounds to the nearest 10p, 25p (could be other values - file driven).
I can't see an obvious way to do this using RPG Free Format, although maybe I need to use a DB2 SQL function (if there is one).
Wondered if anyone had to do something similar or had any ideas on how to achieve this in RPG Free Format.
One reason why we need to do this is to create prices for Ireland, where the smallest coin is 5c, so every price must be in multiples of 0.05.
We are also looking to create sales prices that are rounded, based on a formula, hence the 10p/25p.
Thanks in advance for any ideas.
I know I can do this the "hard way", but hoping there is a function that will make life simpler.
I can't see an obvious way to do this using RPG Free Format, although maybe I need to use a DB2 SQL function (if there is one).
Wondered if anyone had to do something similar or had any ideas on how to achieve this in RPG Free Format.
One reason why we need to do this is to create prices for Ireland, where the smallest coin is 5c, so every price must be in multiples of 0.05.
We are also looking to create sales prices that are rounded, based on a formula, hence the 10p/25p.
Thanks in advance for any ideas.
I know I can do this the "hard way", but hoping there is a function that will make life simpler.
Comment