My question is i have a certain money amount, lets say 552. I wish to split that in its coins/bills => So the result would for example be 1x 500 1x 50 1x 2
I have made 2 arrays for this:
double[] CoinValue = {500, 200, 100, 50, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01};
uint[] CoinAmount = new uint[CoinValue.Length];
My problem is how exactly do i "tell" the array the value for 500 should be 1 in the countAmount array.=> 1. So if i have 1000 the array CoinAmount array would know it would need to hold 2 as value(2x500 = 1000).
So my end result would be something like this, giving the amount of coin/bills: 1 x 500 1 x 50 1 x 2 .......
Thanks in advance.