CloneSet27


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
287250.961SourceElements[16]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1282296
Closure/closure/goog/i18n/numberformat.js
2287262
Closure/closure/goog/locale/numberformat.js
Clone Instance
1
Line Count
282
Source Line
296
Source File
Closure/closure/goog/i18n/numberformat.js

/**
 * Formats a Number to produce a string.
 *
 * @param {number} number The Number to be formatted.
 * @return {string} The formatted number string.
 */
goog.i18n.NumberFormat.prototype.format=  function (number){
  if (isNaN(number)) {
    return goog.i18n.NumberFormatSymbols.NAN;
                     }

  var parts=  [ ];

  // in icu code, it is commented that certain computation need to keep the
  // negative sign for 0.
  var isNegative=  number<  0.0
                   ||              number==  0.0
                                   &&               1/  number<  0.0;
  parts.push(isNegative
             ?            this.negativePrefix_
             :                                   this.positivePrefix_);
  if (!isFinite(number)) {
    parts.push(goog.i18n.NumberFormatSymbols.INFINITY);
                         }
  else   {
    // convert number to non-negative value
    number *= isNegative
              ?            -1
              :                 1;
    number *= this.multiplier_;
    this.useExponentialNotation_?
      this.subformatExponential_(number, parts):
      this.subformatFixed_(number, this.minimumIntegerDigits_, parts);
         }
  parts.push(isNegative
             ?            this.negativeSuffix_
             :                                   this.positiveSuffix_);
  return parts.join('');
                                                           } ;
/**
 * Formats a Number in fraction format.
 *
 * @param {number} number Value need to be formated.
 * @param {number} minIntDigits Minimum integer digits.
 * @param {Array} parts This array holds the pieces of formatted string.
 *     This function will add its formatted pieces to the array.
 * @private
 */
goog.i18n.NumberFormat.prototype.subformatFixed_=
    function (number, minIntDigits, parts){
  // round the number
  var power=  Math.pow(10, this.maximumFractionDigits_);
  number=  Math.round(number*  power);
  var intValue=  Math.floor(number/  power);
  var fracValue=  Math.floor(number-  intValue*  power);

  var fractionPresent=  this.minimumFractionDigits_>  0
                        ||                                 fracValue>  0;
  var intPart=  '';
  var translatableInt=  intValue;
  while (translatableInt>  1E20) {
    // here it goes beyond double precision, add '0' make it look better
    intPart=  '0'+  intPart;
    translatableInt=  Math.round(translatableInt/  10);
                                 }
  intPart=  translatableInt+  intPart;

  var decimal=  goog.i18n.NumberFormatSymbols.DECIMAL_SEP;
  var grouping=  goog.i18n.NumberFormatSymbols.GROUP_SEP;
  var zeroCode=  goog.i18n.NumberFormatSymbols.ZERO_DIGIT.charCodeAt(0);
  var digitLen=  intPart.length;

  if (intValue>  0
      ||              minIntDigits>  0) {
    for (var i=  digitLen; i<  minIntDigits; i++) {
      parts.push(goog.i18n.NumberFormatSymbols.ZERO_DIGIT);
                                                  }

    for (var i=  0; i<  digitLen; i++) {
      parts.push(String.fromCharCode(zeroCode+  intPart.charAt(i)*  1));

      if (digitLen-  i>  1
          &&                  this.groupingSize_>  0
          &&((digitLen-  i)%  this.groupingSize_==  1))
                                                      {
        parts.push(grouping);
                                                      }
                                       }
                                        }
  else   if (!fractionPresent) {
    // If there is no fraction present, and we haven't printed any
    // integer digits, then print a zero.
    parts.push(goog.i18n.NumberFormatSymbols.ZERO_DIGIT);
                               }
  // Output the decimal separator if we always do so.
  if (this.decimalSeparatorAlwaysShown_
      ||                                   fractionPresent) {
    parts.push(decimal);
                                                            }
  var fracPart=  ''+  (fracValue+  power);
  var fracLen=  fracPart.length;
  while (fracPart.charAt(fracLen-  1)==  '0'
         &&fracLen>  this.minimumFractionDigits_+  1)
                                                    {
    fracLen--;
                                                    }
  for (var i=  1; i<  fracLen; i++) {
    parts.push(String.fromCharCode(zeroCode+  fracPart.charAt(i)*  1));
                                    }
                                          } ;
/**
 * Formats exponent part of a Number.
 *
 * @param {number} exponent Exponential value.
 * @param {Array.<string>} parts The array that holds the pieces of formatted
 *     string. This function will append more formatted pieces to the array.
 * @private
 */
goog.i18n.NumberFormat.prototype.addExponentPart_=  function (exponent, parts){
  parts.push(goog.i18n.NumberFormatSymbols.EXP_SYMBOL);

  if (exponent<  0) {
    exponent=  -exponent;
    parts.push(goog.i18n.NumberFormatSymbols.MINUS_SIGN);
                    }

  var exponentDigits=  ''+  exponent;
  for (var i=  exponentDigits.length; i<  this.minExponentDigits_; i++) {
    parts.push(goog.i18n.NumberFormatSymbols.ZERO_DIGIT);
                                                                        }
  parts.push(exponentDigits);
                                                                              } ;
/**
 * Formats Number in exponential format.
 *
 * @param {number} number Value need to be formated.
 * @param {Array.<string>} parts The array that holds the pieces of formatted
 *     string. This function will append more formatted pieces to the array.
 * @private
 */
goog.i18n.NumberFormat.prototype.subformatExponential_=
    function (number, parts){
  if (number==  0.0) {
    this.subformatFixed_(number, this.minimumIntegerDigits_, parts);
    this.addExponentPart_(0, parts);
    return;
                     }

  var exponent=  Math.floor(Math.log(number)/  Math.log(10));
  number /= Math.pow(10, exponent);

  var minIntDigits=  this.minimumIntegerDigits_;
  if (this.maximumIntegerDigits_>  1
      &&this.maximumIntegerDigits_>  this.minimumIntegerDigits_)
                                                               {
    // A repeating range is defined; adjust to it as follows.
    // If repeat == 3, we have 6,5,4=>3; 3,2,1=>0; 0,-1,-2=>-3;
    // -3,-4,-5=>-6, etc. This takes into account that the
    // exponent we have here is off by one from what we expect;
    // it is for the format 0.MMMMMx10^n.
    while ((exponent%  this.maximumIntegerDigits_)!=  0) {
      number *= 10;
      exponent--;
                                                         }
    minIntDigits=  1;
                                                               }
  else   {
    // No repeating range is defined; use minimum integer digits.
    if (this.minimumIntegerDigits_<  1) {
      exponent++;
      number /= 10;
                                        }
    else   {
      exponent-=  this.minimumIntegerDigits_-  1;
      number *= Math.pow(10, this.minimumIntegerDigits_-  1);
           }
         }
  this.subformatFixed_(number, minIntDigits, parts);
  this.addExponentPart_(exponent, parts);
                            } ;
/**
 * Returns the digit value of current character. The character could be either
 * '0' to '9', or a locale specific digit.
 *
 * @param {string} ch Character that represents a digit.
 * @return {number} The digit value, or -1 on error.
 * @private
 */
goog.i18n.NumberFormat.prototype.getDigit_=  function (ch){
  var code=  ch.charCodeAt(0);
  // between '0' to '9'
  if (48<=  code
      &&            code<  58) {
    return code-  48;
                               }
  else   {
    var zeroCode=  goog.i18n.NumberFormatSymbols.ZERO_DIGIT.charCodeAt(0);
    return zeroCode<=  code
           &&                  code<  zeroCode+  10
           ?                                          code-  zeroCode
           :                                                            -1;
         }
                                                          } ;
// ----------------------------------------------------------------------
// CONSTANTS
// ----------------------------------------------------------------------
// Constants for characters used in programmatic (unlocalized) patterns.
/**
 * A zero digit character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_ZERO_DIGIT_=  '0';
/**
 * A grouping separator character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_GROUPING_SEPARATOR_=  ',';
/**
 * A decimal separator character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_DECIMAL_SEPARATOR_=  '.';

/**
 * A per mille character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_PER_MILLE_=  '‰';


/**
 * A percent character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_PERCENT_=  '%';


/**
 * A digit character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_DIGIT_=  '#';


/**
 * A separator character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_SEPARATOR_=  ';';


/**
 * An exponent character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_EXPONENT_=  'E';


/**
 * A minus character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_MINUS_=  '-';


/**
 * A quote character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.PATTERN_CURRENCY_SIGN_=  '¤';


/**
 * A quote character.
 * @type {string}
 * @private
 */
goog.i18n.NumberFormat.QUOTE_=  '\'';


Clone Instance
2
Line Count
287
Source Line
262
Source File
Closure/closure/goog/locale/numberformat.js

/**
 * Formats a Number to produce a string.
 *
 * @param {number} number The Number to be formatted.
 * @return {string} The formatted number string.
 * @deprecated Use goog.i18n.NumberFormat.prototype.format.
 */
goog.locale.NumberFormat.prototype.format=  function (number){
  if (isNaN(number)) {
    return this.symbols_.NAN;
                     }

  var parts=  [ ];

  // in icu code, it is commented that certain computation need to keep the
  // negative sign for 0.
  var isNegative=  number<  0.0
                   ||              number==  0.0
                                   &&               1/  number<  0.0;
  parts.push(isNegative
             ?            this.negativePrefix_
             :                                   this.positivePrefix_);
  if (!isFinite(number)) {
    parts.push(this.symbols_.INFINITY);
                         }
  else   {
    // convert number to non-negative value
    number *= isNegative
              ?            -1
              :                 1;
    number *= this.multiplier_;
    this.useExponentialNotation_?
      this.subformatExponential_(number, parts):
      this.subformatFixed_(number, this.minimumIntegerDigits_, parts);
         }
  parts.push(isNegative
             ?            this.negativeSuffix_
             :                                   this.positiveSuffix_);
  return parts.join('');
                                                             } ;
/**
 * Formats a Number in fraction format.
 *
 * @param {number} number Value need to be formated.
 * @param {number} minIntDigits Minimum integer digits.
 * @param {Array} parts This array holds the pieces of formatted string.
 *     This function will add its formatted pieces to the array.
 * @private
 */
goog.locale.NumberFormat.prototype.subformatFixed_=  function (number,
                                                               minIntDigits,
                                                               parts){
  // round the number
  var power=  Math.pow(10, this.maximumFractionDigits_);
  number=  Math.round(number*  power);
  var intValue=  Math.floor(number/  power);
  var fracValue=  Math.floor(number-  intValue*  power);

  var fractionPresent=  this.minimumFractionDigits_>  0
                        ||                                 fracValue>  0;
  var intPart=  '';
  var translatableInt=  intValue;
  while (translatableInt>  1E20) {
    // here it goes beyond double precision, add '0' make it look better
    intPart=  '0'+  intPart;
    translatableInt=  Math.round(translatableInt/  10);
                                 }
  intPart=  translatableInt+  intPart;

  var decimal=  this.isCurrencyFormat_
                ?                        this.symbols_.MONETARY_SEP
                : this.symbols_.DECIMAL_SEP;
  var grouping=  this.isCurrencyFormat_
                 ?                        this.symbols_.MONETARY_GROUP_SEP
                 : this.symbols_.GROUP_SEP;
  var zeroCode=  this.symbols_.ZERO_DIGIT.charCodeAt(0);
  var digitLen=  intPart.length;
  if (intValue>  0
      ||              minIntDigits>  0) {
    for (var i=  digitLen; i<  minIntDigits; i++) {
      parts.push(this.symbols_.ZERO_DIGIT);
                                                  }

    for (var i=  0; i<  digitLen; i++) {
      parts.push(String.fromCharCode(zeroCode+  intPart.charAt(i)*  1));

      if (digitLen-  i>  1
          &&                  this.groupingSize_>  0
          &&((digitLen-  i)%  this.groupingSize_==  1))
                                                      {
        parts.push(grouping);
                                                      }
                                       }
                                        }
  else   if (!fractionPresent) {
    // If there is no fraction present, and we haven't printed any
    // integer digits, then print a zero.
    parts.push(this.symbols_.ZERO_DIGIT);
                               }
  // Output the decimal separator if we always do so.
  if (this.decimalSeparatorAlwaysShown_
      ||                                   fractionPresent) {
    parts.push(decimal);
                                                            }
  var fracPart=  ''+  (fracValue+  power);
  var fracLen=  fracPart.length;
  while (fracPart.charAt(fracLen-  1)==  '0'
         &&fracLen>  this.minimumFractionDigits_+  1)
                                                    {
    fracLen--;
                                                    }
  for (var i=  1; i<  fracLen; i++) {
    parts.push(String.fromCharCode(zeroCode+  fracPart.charAt(i)*  1));
                                    }
                                                                     } ;
/**
 * Formats exponent part of a Number.
 *
 * @param {number} exponent exponential value.
 * @param {Array} parts This array holds the pieces of formatted string.
 *     This function will add its formatted pieces to the array.
 * @private
 */
goog.locale.NumberFormat.prototype.addExponentPart_=  function (exponent,
                                                                parts){
  parts.push(this.symbols_.EXP_SYMBOL);

  if (exponent<  0) {
    exponent=  -exponent;
    parts.push(this.symbols_.MINUS_SIGN);
                    }

  var exponentDigits=  ''+  exponent;
  for (var i=  exponentDigits.length; i<  this.minExponentDigits_; i++) {
    parts.push(this.symbols_.ZERO_DIGIT);
                                                                        }
  parts.push(exponentDigits);
                                                                      } ;
/**
 * Formats Number in exponential format.
 *
 * @param {number} number Value need to be formated.
 * @param {Array} parts This array holds the pieces of formatted string.
 *     This function will add its formatted pieces to the array.
 * @private
 */
goog.locale.NumberFormat.prototype.subformatExponential_=  function (number,
                                                                     parts){
  if (number==  0.0) {
    this.subformatFixed_(number, this.minimumIntegerDigits_, parts);
    this.addExponentPart_(0, parts);
    return;
                     }

  var exponent=  Math.floor(Math.log(number)/  Math.log(10));
  number /= Math.pow(10, exponent);

  var minIntDigits=  this.minimumIntegerDigits_;
  if (this.maximumIntegerDigits_>  1
      &&this.maximumIntegerDigits_>  this.minimumIntegerDigits_)
                                                               {
    // A repeating range is defined; adjust to it as follows.
    // If repeat == 3, we have 6,5,4=>3; 3,2,1=>0; 0,-1,-2=>-3;
    // -3,-4,-5=>-6, etc. This takes into account that the
    // exponent we have here is off by one from what we expect;
    // it is for the format 0.MMMMMx10^n.
    while ((exponent%  this.maximumIntegerDigits_)!=  0) {
      number *= 10;
      exponent--;
                                                         }
    minIntDigits=  1;
                                                               }
  else   {
    // No repeating range is defined; use minimum integer digits.
    if (this.minimumIntegerDigits_<  1) {
      exponent++;
      number /= 10;
                                        }
    else   {
      exponent-=  this.minimumIntegerDigits_-  1;
      number *= Math.pow(10, this.minimumIntegerDigits_-  1);
           }
         }
  this.subformatFixed_(number, minIntDigits, parts);
  this.addExponentPart_(exponent, parts);
                                                                           } ;
/**
 * Returns the digit value of current character. The character could be either
 * '0' to '9', or a locale specific digit.
 *
 * @param {string} ch Character that represents a digit.
 * @return {number} The digit value, or -1 on error.
 * @private
 */
goog.locale.NumberFormat.prototype.getDigit_=  function (ch){
  var code=  ch.charCodeAt(0);
  // between '0' to '9'
  if (48<=  code
      &&            code<  58) {
    return code-  48;
                               }
  else   {
    var zeroCode=  this.symbols_.ZERO_DIGIT.charCodeAt(0);
    return zeroCode<=  code
           &&                  code<  zeroCode+  10
           ?                                          code-  zeroCode
           :                                                            -1;
         }
                                                            } ;
// ----------------------------------------------------------------------
// CONSTANTS
// ----------------------------------------------------------------------
// Constants for characters used in programmatic (unlocalized) patterns.
/**
 * A zero digit character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_ZERO_DIGIT_=  '0';
/**
 * A grouping separator character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_GROUPING_SEPARATOR_=  ',';
/**
 * A decimal separator character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_DECIMAL_SEPARATOR_=  '.';

/**
 * A per mille character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_PER_MILLE_=  '‰';


/**
 * A percent character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_PERCENT_=  '%';


/**
 * A digit character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_DIGIT_=  '#';


/**
 * A separator character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_SEPARATOR_=  ';';


/**
 * An exponent character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_EXPONENT_=  'E';


/**
 * A minus character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_MINUS_=  '-';


/**
 * A quote character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.PATTERN_CURRENCY_SIGN_=  '¤';


/**
 * A quote character.
 * @type {string}
 * @private
 */
goog.locale.NumberFormat.QUOTE_=  '\'';


Clone AbstractionParameter Count: 5Parameter Bindings

/**
 * Formats a Number to produce a string.
 *
 * @param {number} number The Number to be formatted.
 * @return {string} The formatted number string.
 * @deprecated Use goog.i18n.NumberFormat.prototype.format.
 */
/**
 * Formats a Number to produce a string.
 *
 * @param {number} number The Number to be formatted.
 * @return {string} The formatted number string.
 */
goog. [[#variable20f2ba80]].NumberFormat.prototype.format= function (number)
                                                           { if (isNaN(number))
                                                               { return [[#variable20f2ba00]]. [[#variable20f2b760]].NAN;
                                                               }
                                                             var parts=[ ];
                                                             // in icu code, it is commented that certain computation need to keep the
                                                             // negative sign for 0.
                                                             var isNegative=number<0.0
                                                                            || number==0.0
                                                                               && 1/number<0.0;
                                                             parts.push(isNegative
                                                                        ?this.negativePrefix_
                                                                        : this.positivePrefix_);
                                                             if (!isFinite(number))
                                                               { parts.push( [[#variable20f2ba00]]. [[#variable20f2b760]].INFINITY);
                                                               }
                                                             else
                                                               {
                                                                 // convert number to non-negative value
                                                                 number *= isNegative
                                                                           ?-1
                                                                           : 1;
                                                                 number *= this.multiplier_;
                                                                 this.useExponentialNotation_?
                                                                   this.subformatExponential_(number,parts):
                                                                   this.subformatFixed_(number,this.minimumIntegerDigits_,parts);
                                                               }
                                                             parts.push(isNegative
                                                                        ?this.negativeSuffix_
                                                                        : this.positiveSuffix_);
                                                             return parts.join('');
                                                           } ;
/**
 * Formats a Number in fraction format.
 *
 * @param {number} number Value need to be formated.
 * @param {number} minIntDigits Minimum integer digits.
 * @param {Array} parts This array holds the pieces of formatted string.
 *     This function will add its formatted pieces to the array.
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.prototype.subformatFixed_= function (number,minIntDigits,parts)
                                                                    {
                                                                      // round the number
                                                                      var power=Math.pow(10,this.maximumFractionDigits_);
                                                                      number=Math.round(number*power);
                                                                      var intValue=Math.floor(number/power);
                                                                      var fracValue=Math.floor(number-intValue*power);
                                                                      var fractionPresent=this.minimumFractionDigits_>0
                                                                                          || fracValue>0;
                                                                      var intPart='';
                                                                      var translatableInt=intValue;
                                                                      while (translatableInt>1E20)
                                                                        {
                                                                          // here it goes beyond double precision, add '0' make it look better
                                                                          intPart='0'+intPart;
                                                                          translatableInt=Math.round(translatableInt/10);
                                                                        }
                                                                      intPart=translatableInt+intPart;
                                                                      var decimal= [[#variable414b0320]];
                                                                      var grouping= [[#variable20f2b380]];
                                                                      var zeroCode= [[#variable20f2ba00]]. [[#variable20f2b760]].ZERO_DIGIT.charCodeAt(0);
                                                                      var digitLen=intPart.length;
                                                                      if (intValue>0
                                                                          || minIntDigits>0)
                                                                        { for (var i=digitLen; i<minIntDigits; i++)
                                                                            { parts.push( [[#variable20f2ba00]]. [[#variable20f2b760]].ZERO_DIGIT);
                                                                            }
                                                                          for (var i=0; i<digitLen; i++)
                                                                            { parts.push(String.fromCharCode(zeroCode+intPart.charAt(i)*1));
                                                                              if (digitLen-i>1
                                                                                  && this.groupingSize_>0
                                                                                  && ((digitLen-i)%this.groupingSize_==1))
                                                                                { parts.push(grouping);
                                                                                }
                                                                            }
                                                                        }
                                                                      else
                                                                        if (!fractionPresent)
                                                                          {
                                                                            // If there is no fraction present, and we haven't printed any
                                                                            // integer digits, then print a zero.
                                                                            parts.push( [[#variable20f2ba00]]. [[#variable20f2b760]].ZERO_DIGIT);
                                                                          }
                                                                      // Output the decimal separator if we always do so.
                                                                      if (this.decimalSeparatorAlwaysShown_
                                                                          || fractionPresent)
                                                                        { parts.push(decimal);
                                                                        }
                                                                      var fracPart=''+(fracValue+power);
                                                                      var fracLen=fracPart.length;
                                                                      while (fracPart.charAt(fracLen-1)=='0'
                                                                             && fracLen>this.minimumFractionDigits_+1)
                                                                        { fracLen--;
                                                                        }
                                                                      for (var i=1; i<fracLen; i++)
                                                                        { parts.push(String.fromCharCode(zeroCode+fracPart.charAt(i)*1));
                                                                        }
                                                                    } ;
/**
 * Formats exponent part of a Number.
 *
 * @param {number} exponent exponential value.
 * @param {Array} parts This array holds the pieces of formatted string.
 *     This function will add its formatted pieces to the array.
 * @private
 */
/**
 * Formats exponent part of a Number.
 *
 * @param {number} exponent Exponential value.
 * @param {Array.<string>} parts The array that holds the pieces of formatted
 *     string. This function will append more formatted pieces to the array.
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.prototype.addExponentPart_= function (exponent,parts)
                                                                     { parts.push( [[#variable20f2ba00]]. [[#variable20f2b760]].EXP_SYMBOL);
                                                                       if (exponent<0)
                                                                         { exponent=-exponent;
                                                                           parts.push( [[#variable20f2ba00]]. [[#variable20f2b760]].MINUS_SIGN);
                                                                         }
                                                                       var exponentDigits=''+exponent;
                                                                       for (var i=exponentDigits.length; i<this.minExponentDigits_; i++)
                                                                         { parts.push( [[#variable20f2ba00]]. [[#variable20f2b760]].ZERO_DIGIT);
                                                                         }
                                                                       parts.push(exponentDigits);
                                                                     } ;
/**
 * Formats Number in exponential format.
 *
 * @param {number} number Value need to be formated.
 * @param {Array} parts This array holds the pieces of formatted string.
 *     This function will add its formatted pieces to the array.
 * @private
 */
/**
 * Formats Number in exponential format.
 *
 * @param {number} number Value need to be formated.
 * @param {Array.<string>} parts The array that holds the pieces of formatted
 *     string. This function will append more formatted pieces to the array.
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.prototype.subformatExponential_= function (number,parts)
                                                                          { if (number==0.0)
                                                                              { this.subformatFixed_(number,this.minimumIntegerDigits_,parts);
                                                                                this.addExponentPart_(0,parts);
                                                                                return;
                                                                              }
                                                                            var exponent=Math.floor(Math.log(number)/Math.log(10));
                                                                            number /= Math.pow(10,exponent);
                                                                            var minIntDigits=this.minimumIntegerDigits_;
                                                                            if (this.maximumIntegerDigits_>1
                                                                                && this.maximumIntegerDigits_>this.minimumIntegerDigits_)
                                                                              {
                                                                                // A repeating range is defined; adjust to it as follows.
                                                                                // If repeat == 3, we have 6,5,4=>3; 3,2,1=>0; 0,-1,-2=>-3;
                                                                                // -3,-4,-5=>-6, etc. This takes into account that the
                                                                                // exponent we have here is off by one from what we expect;
                                                                                // it is for the format 0.MMMMMx10^n.
                                                                                while ((exponent%this.maximumIntegerDigits_)!=0)
                                                                                  { number *= 10;
                                                                                    exponent--;
                                                                                  }
                                                                                minIntDigits=1;
                                                                              }
                                                                            else
                                                                              {
                                                                                // No repeating range is defined; use minimum integer digits.
                                                                                if (this.minimumIntegerDigits_<1)
                                                                                  { exponent++;
                                                                                    number /= 10;
                                                                                  }
                                                                                else
                                                                                  { exponent-=this.minimumIntegerDigits_-1;
                                                                                    number *= Math.pow(10,this.minimumIntegerDigits_-1);
                                                                                  }
                                                                              }
                                                                            this.subformatFixed_(number,minIntDigits,parts);
                                                                            this.addExponentPart_(exponent,parts);
                                                                          } ;
/**
 * Returns the digit value of current character. The character could be either
 * '0' to '9', or a locale specific digit.
 *
 * @param {string} ch Character that represents a digit.
 * @return {number} The digit value, or -1 on error.
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.prototype.getDigit_= function (ch)
                                                              { var code=ch.charCodeAt(0);
                                                                // between '0' to '9'
                                                                if (48<=code
                                                                    && code<58)
                                                                  { return code-48;
                                                                  }
                                                                else
                                                                  { var zeroCode= [[#variable20f2ba00]]. [[#variable20f2b760]].ZERO_DIGIT.charCodeAt(0);
                                                                    return zeroCode<=code
                                                                           && code<zeroCode+10
                                                                           ?code-zeroCode
                                                                           : -1;
                                                                  }
                                                              } ;
// ----------------------------------------------------------------------
// CONSTANTS
// ----------------------------------------------------------------------
// Constants for characters used in programmatic (unlocalized) patterns.
/**
 * A zero digit character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_ZERO_DIGIT_='0';
/**
 * A grouping separator character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_GROUPING_SEPARATOR_=',';
/**
 * A decimal separator character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_DECIMAL_SEPARATOR_='.';
/**
 * A per mille character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_PER_MILLE_='‰';
/**
 * A percent character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_PERCENT_='%';
/**
 * A digit character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_DIGIT_='#';
/**
 * A separator character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_SEPARATOR_=';';
/**
 * An exponent character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_EXPONENT_='E';
/**
 * A minus character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_MINUS_='-';
/**
 * A quote character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.PATTERN_CURRENCY_SIGN_='¤';
/**
 * A quote character.
 * @type {string}
 * @private
 */
goog. [[#variable20f2ba80]].NumberFormat.QUOTE_='\'';
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#20f2ba80]]
locale 
12[[#20f2ba80]]
i18n 
21[[#20f2ba00]]
this 
22[[#20f2ba00]]
goog.i18n 
31[[#20f2b760]]
symbols_ 
32[[#20f2b760]]
NumberFormatSymbols 
41[[#414b0320]]
this.isCurrencyFormat_
?this.symbols_.MONETARY_SEP
: this.symbols_.DECIMAL_SEP 
42[[#414b0320]]
goog.i18n.NumberFormatSymbols.DECIMAL_SEP 
51[[#20f2b380]]
this.isCurrencyFormat_
?this.symbols_.MONETARY_GROUP_SEP
: this.symbols_.GROUP_SEP 
52[[#20f2b380]]
goog.i18n.NumberFormatSymbols.GROUP_SEP