First number needs to be rounded to nearest second number. There are many ways of doing this, but whats the best and shortest algorithm? Anyone up for a challenge :-)
As per Pawan Pillai's comment above, rounding to nearest 100th in Javascript: 100 * Math.floor((foo + 50) / 100);
100 * Math.floor((foo + 50) / 100);