function limitDecimalPlaces(originalNumber, placesToLimitTo){
  originalNumber = originalNumber.toString();
  var decimalIndex = originalNumber.search(/\./);

  //if there was a decimal point, then go from the start of the string
  //to one more after the decimal index (because we want the decimal) plus
  //the placesToLimitTo that was passed in
  if (decimalIndex >= -1) {
    var limitedToTwoDecimal = originalNumber.substring(0, decimalIndex + 1+ placesToLimitTo);
  }
  else{
    var limitedToTwoDecimal = originalNumber;
  }

  return(limitedToTwoDecimal);
}