I have been trying to find a solution to the below problem:
I'm dealing with Kuwaiti currency in which the lowest amount is 5 fils (coins) and the highest amount is 20 Kuwaiti Dinars (bill notes).
The number format is X.XXX (KD.fils) in which the largest number of decimal digits after the "dot" is 3.
The KD can be any number from 0 to infinity, however, the fils exist only in 5 increments: eg. 000 fils, 005 fils, 010 fils, 015 fils, 985 fils, 990 fils, all the way up to 1000 (1.000 KD).
Given the following:
1) 12.583 ---- 12.585
2) 12.582 ---- 12.580
3) 100.247 ---- 100.250
4) 100.999 ---- 101.000
5) 1009.998 ---- 1010.000
6) 1009.992 ---- 1009.990
How do I round the last three decimal numbers to the nearest 5 and, if the number exists as it does in example no. 4 and 5, it should round it to the next whole KD ie from 100 KD to 101 KD in the case of example 4 (the condition is when fils exceeds 995)
How can I achieve the above?