View Full Version : Postage Calculator returns too many results

09-04-2007, 08:53 PM

I've attached my source code in its HTML page as a text file. Sorry I couldn't choose which part to quote here.

My Goal:
I needed an easy way to calculate which stamps to use for various postage values.

So I searched for a javascript that was doing the same thing and tweaked it (changing the values of the stamps and increasing the number of stamp denominations from 5 to 7). It works really well with no errors.

Unfortunately, because I've added denominations (now 7), the number of posssible combinations has increased dramatically for higher postage values. Of course, most of the possible combinations are impractical and therefore redundant (e.g. requiring 38 penny stamps) and by the time you get to 2.92 for the postage value the result never arrives (presumeably because it will take a while to calculate?).

Can you suggest a way to limit the results to practical combinations and prevent large postage values from producing all possible combinations?