lib/common.js
function stringToNumber(str, base) {
  var sanitized, isDecimal;
  sanitized = str.replace(fullWidthNumberReg, function(chr) {
    var replacement = getOwn(fullWidthNumberMap, chr);
    if (replacement === HALF_WIDTH_PERIOD) {
      isDecimal = true;
    }
    return replacement;
  });
  return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);
}
function stringToNumber(str, base) {
  var sanitized, isDecimal;
  sanitized = str.replace(fullWidthNumberReg, function(chr) {
    var replacement = getOwn(fullWidthNumberMap, chr);
    if (replacement === HALF_WIDTH_PERIOD) {
      isDecimal = true;
    }
    return replacement;
  });
  return isDecimal ? parseFloat(sanitized) : parseInt(sanitized, base || 10);
}
function stringToNumber ( str , base ) { var sanitized , isDecimal ; sanitized = str . replace ( fullWidthNumberReg , function ( chr ) { var replacement = getOwn ( fullWidthNumberMap , chr ) ; if ( replacement === HALF_WIDTH_PERIOD ) { isDecimal = true ; } return replacement ; } ) ; return isDecimal ? parseFloat ( sanitized ) : parseInt ( sanitized , base || 10 ) ; }
Takes into account full-width characters, commas, and decimals.
Takes into account full - width characters commas and decimals .