Help with Donation "Calculator" function

Options

Referring to the "donation" calculator on this page: http://fbcm.convio.net/site/PageServer?pagename=FMF2009EOY

I'm trying to correct the function below so that it calculates correctly.

Donation sums from $1-16 should put a "0" in the "Feed a Family of Four for ..." field

Donation sums from $17-33 should put a "1" in the "Feed a Family of Four for ..." field

Donation sums from $34-50 should put a "2" in the "Feed a Family of Four for ..." field

etc...

However, the function below does not do that accurately. I logged a support ticket and they said I would get a better solution by putting it out to community. Can anyone help?

function calcNumDat(sum) {

  var numericData = new Array();

  numericData = Math.round(sum / 17);

  numericData = sum * 5;

  numericData = sum * 6;

  numericData = sum * 10;

Tagged:

Categories