Function that divides money with regard to the smallest denomination
I can make infinite money (well, as much as will fit in a javascript number) with your code!

var money = 10;
while(true){
    money = divideMoney(money, [3, 0], 1)[0];//muhahahahah infinite money
}


Which divides the money like so: 1 for me, 1 for myself, 1 for I, none for you. 1 for me...

I'd recommend in this case to fall back on relative percentages: that is, sum the percentages and then set the cut to be the percentage of the summed percentage. So 10, 5, 5 = 20 total, 10/20 = 0.5, 5/20 = 0.25, so it's 0.50, 0.25, 0.25.