spreadsheet/ruleJS.all.full.js
function unformatNumeral (n, string) {
    var stringOriginal = string,
      thousandRegExp,
      millionRegExp,
      billionRegExp,
      trillionRegExp,
      suffixes = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
      bytesMultiplier = false,
      power;

    if (string.indexOf(':') > -1) {
      n._value = unformatTime(string);
    } else {
      if (string === zeroFormat) {
        n._value = 0;
      } else {
        if (languages[currentLanguage].delimiters.decimal !== '.') {
          string = string.replace(/\./g,'').replace(languages[currentLanguage].delimiters.decimal, '.');
        }

        // see if abbreviations are there so that we can multiply to the correct number
        thousandRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.thousand + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
        millionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.million + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
        billionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.billion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
        trillionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.trillion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');

        // see if bytes are there so that we can multiply to the correct number
        for (power = 0; power <= suffixes.length; power++) {
          bytesMultiplier = (string.indexOf(suffixes[power]) > -1) ? Math.pow(1024, power + 1) : false;

          if (bytesMultiplier) {
            break;
          }
        }

        // do some math to create our number
        n._value = ((bytesMultiplier) ? bytesMultiplier : 1) * ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) * ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) * ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) * ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) * ((string.indexOf('%') > -1) ? 0.01 : 1) * (((string.split('-').length + Math.min(string.split('(').length-1, string.split(')').length-1)) % 2)? 1: -1) * Number(string.replace(/[^0-9\.]+/g, ''));

        // round if we are talking about bytes
        n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value;
      }
    }
    return n._value;
  }
function unformatNumeral (n, string) {
    var stringOriginal = string,
      thousandRegExp,
      millionRegExp,
      billionRegExp,
      trillionRegExp,
      suffixes = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
      bytesMultiplier = false,
      power;

    if (string.indexOf(':') > -1) {
      n._value = unformatTime(string);
    } else {
      if (string === zeroFormat) {
        n._value = 0;
      } else {
        if (languages[currentLanguage].delimiters.decimal !== '.') {
          string = string.replace(/\./g,'').replace(languages[currentLanguage].delimiters.decimal, '.');
        }

        // see if abbreviations are there so that we can multiply to the correct number
        thousandRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.thousand + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
        millionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.million + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
        billionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.billion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
        trillionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.trillion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');

        // see if bytes are there so that we can multiply to the correct number
        for (power = 0; power <= suffixes.length; power++) {
          bytesMultiplier = (string.indexOf(suffixes[power]) > -1) ? Math.pow(1024, power + 1) : false;

          if (bytesMultiplier) {
            break;
          }
        }

        // do some math to create our number
        n._value = ((bytesMultiplier) ? bytesMultiplier : 1) * ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) * ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) * ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) * ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) * ((string.indexOf('%') > -1) ? 0.01 : 1) * (((string.split('-').length + Math.min(string.split('(').length-1, string.split(')').length-1)) % 2)? 1: -1) * Number(string.replace(/[^0-9\.]+/g, ''));

        // round if we are talking about bytes
        n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value;
      }
    }
    return n._value;
  }
function unformatNumeral ( n , string ) { var stringOriginal = string , thousandRegExp , millionRegExp , billionRegExp , trillionRegExp , suffixes = [ 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' , 'ZB' , 'YB' ] , bytesMultiplier = false , power ; if ( string . indexOf ( ':' ) > - 1 ) { n . _value = unformatTime ( string ) ; } else { if ( string === zeroFormat ) { n . _value = 0 ; } else { if ( languages [ currentLanguage ] . delimiters . decimal !== '.' ) { string = string . replace ( / \. / g , '' ) . replace ( languages [ currentLanguage ] . delimiters . decimal , '.' ) ; } // see if abbreviations are there so that we can multiply to the correct number thousandRegExp = new RegExp ( '[^a-zA-Z]' + languages [ currentLanguage ] . abbreviations . thousand + '(?:\\)|(\\' + languages [ currentLanguage ] . currency . symbol + ')?(?:\\))?)?$' ) ; millionRegExp = new RegExp ( '[^a-zA-Z]' + languages [ currentLanguage ] . abbreviations . million + '(?:\\)|(\\' + languages [ currentLanguage ] . currency . symbol + ')?(?:\\))?)?$' ) ; billionRegExp = new RegExp ( '[^a-zA-Z]' + languages [ currentLanguage ] . abbreviations . billion + '(?:\\)|(\\' + languages [ currentLanguage ] . currency . symbol + ')?(?:\\))?)?$' ) ; trillionRegExp = new RegExp ( '[^a-zA-Z]' + languages [ currentLanguage ] . abbreviations . trillion + '(?:\\)|(\\' + languages [ currentLanguage ] . currency . symbol + ')?(?:\\))?)?$' ) ; // see if bytes are there so that we can multiply to the correct number for ( power = 0 ; power <= suffixes . length ; power ++ ) { bytesMultiplier = ( string . indexOf ( suffixes [ power ] ) > - 1 ) ? Math . pow ( 1024 , power + 1 ) : false ; if ( bytesMultiplier ) { break ; } } // do some math to create our number n . _value = ( ( bytesMultiplier ) ? bytesMultiplier : 1 ) * ( ( stringOriginal . match ( thousandRegExp ) ) ? Math . pow ( 10 , 3 ) : 1 ) * ( ( stringOriginal . match ( millionRegExp ) ) ? Math . pow ( 10 , 6 ) : 1 ) * ( ( stringOriginal . match ( billionRegExp ) ) ? Math . pow ( 10 , 9 ) : 1 ) * ( ( stringOriginal . match ( trillionRegExp ) ) ? Math . pow ( 10 , 12 ) : 1 ) * ( ( string . indexOf ( '%' ) > - 1 ) ? 0.01 : 1 ) * ( ( ( string . split ( '-' ) . length + Math . min ( string . split ( '(' ) . length - 1 , string . split ( ')' ) . length - 1 ) ) % 2 ) ? 1 : - 1 ) * Number ( string . replace ( / [^0-9\.]+ / g , '' ) ) ; // round if we are talking about bytes n . _value = ( bytesMultiplier ) ? Math . ceil ( n . _value ) : n . _value ; } } return n . _value ; }
revert to number
revert to number