亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? numberformat.as

?? actionscript3 cookbook 源代碼S3CBLibrary
?? AS
?? 第 1 頁 / 共 2 頁
字號:
package ascb.util {
	
  public class NumberFormat {

    private var _sMask:String;

    /**
     *  Get and set the mask for the formatting. The mask can consist of 0's, #'s,
     *  commas, and dots.
     */
    public function get mask():String {
      return _sMask;
    }

    public function set mask(sMask:String):void {
      _sMask = sMask;
    }

    public function NumberFormat(sMask:String = null) {
      _sMask = sMask;
    }

    /**
     *  Format a number. If no mask has been set then the standard formatting
     *  for the locale is used. Optionally, you may specify radix, prefix, locale,
     *  and/or symbol object parameters.
     *  <p>
     *  Example usage: <br />
     *  trace(nfFormatter.format(1000)); // Displays 1,000 <br />
     *  trace(nfFormatter.format(1000, 16));  // Displays: 0x3E8 <br />
     *  trace(nfFormatter.format(1000, 16, "#"));  // Displays: #3E8 <br />
     *  trace(nfFormatter.format(1000, new Locale("fr")));  // Displays: 1.000 <br />
     *  trace(nfFormatter.format(1000, {group: "|", decimal: "%"}));  // Displays: 1|000 <br />   
     *  </p>
     *  to the nearest of a specified interval.
     *  @param  number          The number you want to format.
     *  @param  radix           (optional) The radix by which to display the number.
     *  @param  prefix          (optional) The prefix to use when specifying the radix.ber.
     *  @param  locale          (optional) A Locale object.
     *  @param  symbols object  (optional) An object specifying the group and decimal symbols.
     *  @return                 The formatted number as a string.
     */
    public function format(nNumber:Number, oParameter1:Object = null, oParameter2:Object = null):String {
      // Check to see if the second parameter is a number. If so, that means it's the radix,
      // so format the number based on the radix.
      if(typeof oParameter1 == "number") {
        var nRadix:Number = Number(oParameter1);
        var sNumber:String = nNumber.toString(nRadix);

        // See if there's an approprate prefix of either 0x or 0.
        // Optionally, the prefix may be specified as a third parameter.
        var sPrefix:String = "";
        if(nRadix == 16) {
          sPrefix = "0x";
        }
        if(nRadix == 8) {
          sPrefix = "0";
        }

        // If a prefix is specified, use that instead.
        if(oParameter2 != null) {
          sPrefix = String(oParameter2);
        }

        // Return the formatted number as a string.
        return sPrefix + sNumber.toUpperCase();
      }

      var sNumber:String;
      var sDecimal:String = ",";
      var sGroup:String = ".";

      // Check to see if the second parameter is a symbols object.
      if(oParameter1 != null && oParameter1.hasOwnProperty("group")) {
        var oSymbols:Object = oParameter1;
      }
      else {
        // If the second parameter was not the radix and not a symbols
        // object, then it's a locale.
        var lLocale:Locale = Locale(oParameter1);

        // If the locale is undefined, create a new locale with default settings.
        if(lLocale == null) {
          lLocale = new Locale();
        }
        var lStyle:Locale = Locale(lLocale);

        // Get the symbols for the formatting based on the locale - includes grouping,
        // decimal, etc.
        var oSymbols:Object = getSymbols(false, lStyle);
      }

      sDecimal = oSymbols.decimal;
      sGroup = oSymbols.group;

      // Split the number into two arrays of characters.
      var aParts:Array = String(nNumber).split(".");
      var aPart0:Array = aParts[0].split("");
      var aPart1:Array = (aParts.length > 1) ? aParts[1].split("") : new Array();

      // If the mask is not defined, then use default formatting.
      if(_sMask == null) {
        var nCounter:Number = 1;
        aPart0.reverse();

        // Loop through the characters of the first array in reverse order.
        // Every third number add a grouping symbol.
        for(var i:Number = 0; i < aPart0.length; i++) {
          if(nCounter > 3) {
            nCounter = 0;
            aPart0.splice(i, 0, sGroup);
          }
          nCounter++;
        }
        aPart0.reverse();

        // Join the characters back to a string, then concatenate the decimal symbol
        // and the second part of the number.
        sNumber = aPart0.join("");
        if(aParts[1] != null) {
          sNumber += sDecimal + aParts[1];
        }
      }
      else {

        // Otherwise, the mask was specified, so use it to format the number.

        // Split the mask into arrays of characters.
        var aMask:Array = _sMask.split("");
        for(var i:Number = 0; i < aMask.length; i++) {
          if(aMask[i] != "0" && aMask[i] != "#" && aMask[i] != ".") {
            aMask.splice(i, 1);
            i--;
          }
        }
        aMask = aMask.join("").split(".");
        var aMask0:Array = aMask[0].split("");
        var aMask1:Array = (aMask.length > 1) ? aMask[1].split("") : new Array();
        var nCounter:Number = aMask0.length;

        var nPart0Index:Number = 0;
        var nMaskIndex:Number = 0;
        sNumber = "";

        // If nCounter is less than the length of the first part of the number string,
        // then that means that several characters of the first part of the number string
        // need to get added to the return string before dealing with the mask.
        if(nCounter < aPart0.length) {
          for(var i:Number = 0; i < aPart0.length - nCounter; i++) {
            sNumber += aPart0[i];
            nPart0Index++;
          }
        }
        else if(nCounter > aPart0.length) {
          // Otherwise, if the number of mask character is greater than the digit in the number,
          // Add leading zeros or spaces.
          for(var i:Number = 0; i < nCounter - aPart0.length; i++) {
            if(aMask0[i] == "0") {
              sNumber += "0";
            }
            else if (aMask0[i] == "#") {
              sNumber += " ";
            }
            nMaskIndex++;
          }
        }

        var bNumeric:Boolean = false;

        // Loop through each of the remaining characters in the mask.
        for(var i:Number = nMaskIndex; i < aMask0.length; i++) {

          // If the mask character is anything other than a # or 0, and no other
          // numeric character has yet been encountered, then use a space. Otherwise
          // if it's a 0 or # add the number, and if it's a comma add the grouping
          // symbol.
          if(aMask0[i] == "0" || aMask0[i] == "#") {
            sNumber += (aPart0[nPart0Index] == undefined) ? "" : aPart0[nPart0Index];
            nPart0Index++;
          }
        }

        // Split the mask string into an array using the dot as the
        // delimiter. Then split the first element of that array into an array
        // of characters.
        aMask = _sMask.split(".");
        aMask = aMask[0].split("");

        // Split the number string into an array of characters.
        var aNumber:Array = sNumber.split("");

        // Declare a variable and initialize it to false. This variable is
        // to keep track of whether or not a numeric value has been encountered
        // yet.
        var bNumeric:Boolean = false;

        // Loop through each element of the array of mask characters.
        for(var i:Number = 0; i < aMask.length; i++) {

          // Check to see if the element of the mask is one of the special
          // mask characters.
          if(aMask[i] != "0" && aMask[i] != "#" && aMask[i] != ".") {

            // If a numeric character has been encountered then add a grouping
            // symbol to the number. Otherwise add a space.
            if(bNumeric) {
              aNumber.splice(i, 0, sGroup);
            }
            else {
              aNumber.splice(i, 0, " ");
            }
          }

          // Check to see if the current character is numeric (and non-zero).
          if(aNumber[i] != " " && aNumber[i] != "0") {
            bNumeric = true;
          }
        }

        // Join the characters in the array back to a string.
        sNumber = aNumber.join("");

        // If there's a second part to the mask, then append the decimal
        // symbol to the number.
        if(aMask1.length > 0) {
          sNumber += sDecimal;
        }

        var nDigits:Number;

        // Loop through each element of the second mask part.
        for(var i:Number = 0; i < aMask1.length; i++) {

          // Check to see if the character in the second number part is
          // defined.
          if(aPart1[i] == null) {

            // If the character is undefined then append either a 0 or a space
            // if the corresponding character in the mask array is either 0 or
            // a #.
            if(aMask1[i] == "0") {
              sNumber += "0";
            }
            else if(aMask1[i] == "#") {
              sNumber += " ";
            }
          }
          else {

            // Otherwise, the character in the number array is defined, so
            // append the number to the number string. If it happens to be the
            // last element in the mask string then round the next two digits.
            // Otherwise, just append the next digit.
            nDigits = Number(aPart1[i] + "" + aPart1[i + 1]);
            if(i == aMask1.length - 1 && !isNaN(nDigits)) {
              sNumber += String(Math.round(nDigits/10));
            }
            else {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩欧美精品在线| 亚洲成人动漫精品| 亚洲成人激情社区| 国产精品一区二区x88av| 91视频一区二区| 久久综合色8888| 无码av免费一区二区三区试看| 韩国成人福利片在线播放| 91国偷自产一区二区开放时间| 久久色.com| 日本不卡中文字幕| 欧美亚洲图片小说| 最新中文字幕一区二区三区| 国产在线观看免费一区| 欧美久久久久免费| 亚洲精品国产无套在线观 | 日韩一卡二卡三卡国产欧美| 亚洲理论在线观看| 成人影视亚洲图片在线| 精品福利一区二区三区 | 亚洲精品一二三区| 懂色av中文一区二区三区 | 久久黄色级2电影| 欧美日韩免费一区二区三区| 亚洲你懂的在线视频| 99精品国产99久久久久久白柏| 久久日韩精品一区二区五区| 日本亚洲电影天堂| 欧美一区二区大片| 老司机精品视频导航| 日韩女优毛片在线| 精彩视频一区二区三区| 日韩欧美的一区二区| 精品一区二区三区免费视频| 日韩欧美国产高清| 国产在线视频精品一区| 久久精品一区二区三区av| 国产在线视频不卡二| 亚洲精品一区二区三区香蕉| 国产精品影视在线| 国产精品免费视频网站| 本田岬高潮一区二区三区| 国产精品入口麻豆原神| 99久久久无码国产精品| 亚洲精品国产一区二区精华液| 一本一道波多野结衣一区二区| 一区二区三区美女视频| 91精品国产综合久久蜜臀| 久久超碰97中文字幕| 久久女同精品一区二区| zzijzzij亚洲日本少妇熟睡| 一区二区视频在线| 欧美军同video69gay| 国产在线视频不卡二| 亚洲国产成人午夜在线一区| 91日韩一区二区三区| 日韩高清不卡一区二区三区| 精品福利一区二区三区免费视频| 成人丝袜18视频在线观看| 一二三区精品视频| 欧美成人精品3d动漫h| 国产suv精品一区二区三区| 日韩久久一区二区| 日韩亚洲欧美综合| 成人免费观看男女羞羞视频| 亚洲国产精品久久人人爱蜜臀 | 色爱区综合激月婷婷| 日韩av一区二| 国产精品美女一区二区| 欧美日本精品一区二区三区| 国产精品99久久不卡二区| 樱花影视一区二区| 欧美精品一区二区三区一线天视频 | 午夜欧美在线一二页| 久久久国产精华| 欧美日韩不卡视频| 成人午夜av影视| 美日韩黄色大片| 亚洲美女屁股眼交3| 精品国产乱码久久久久久图片| 91精品福利视频| 国产黄色精品视频| 日韩av不卡在线观看| 亚洲另类一区二区| 国产精品你懂的在线欣赏| 欧美一区二区在线播放| 色88888久久久久久影院野外 | 欧美高清在线精品一区| 欧美一级理论性理论a| 色综合久久综合中文综合网| 国产一区二区福利| 老司机免费视频一区二区三区| 亚洲一区二区三区在线看| 欧美激情在线一区二区| 精品福利一二区| 日韩欧美久久久| 欧美一二三区在线| 精品视频在线免费| 一本色道久久加勒比精品| 成人福利视频网站| 顶级嫩模精品视频在线看| 精品在线一区二区| 久久国产尿小便嘘嘘尿| 日韩在线a电影| 亚洲成人av一区二区三区| 亚洲综合视频网| 亚洲综合色自拍一区| 亚洲综合一二三区| 亚洲午夜在线视频| 亚洲国产中文字幕| 亚洲高清免费一级二级三级| 一区二区免费看| 亚洲综合清纯丝袜自拍| 亚洲另类一区二区| 亚洲成人一区二区在线观看| 亚洲一区二区在线免费看| 亚洲色图欧美激情| 亚洲自拍欧美精品| 亚洲成人先锋电影| 青青草国产精品亚洲专区无| 奇米一区二区三区| 麻豆freexxxx性91精品| 国产综合色视频| 懂色av中文字幕一区二区三区| 不卡视频一二三| 色综合天天综合在线视频| 在线观看亚洲专区| 欧美日韩国产a| 精品国产污污免费网站入口| 久久亚洲一区二区三区明星换脸| 国产亚洲女人久久久久毛片| 中文字幕国产一区| 一区二区三区四区亚洲| 日韩在线卡一卡二| 国产精品一区二区在线观看不卡 | |精品福利一区二区三区| 一区二区三区精品在线| 奇米亚洲午夜久久精品| 国产一区高清在线| 99re这里都是精品| 欧美剧情电影在线观看完整版免费励志电影 | 国产精品麻豆网站| 一区二区三区在线不卡| 婷婷国产在线综合| 国产成人一级电影| 91浏览器打开| 日韩精品一区二区三区老鸭窝| 国产欧美精品一区二区色综合| 一区二区三区四区视频精品免费 | 国产精品欧美极品| 五月综合激情婷婷六月色窝| 久久国产精品99久久久久久老狼| 国产成人在线影院| 精品视频1区2区| 国产精品素人视频| 日韩综合小视频| 成人av电影在线观看| 91精品国产综合久久国产大片| 国产欧美日韩在线视频| 天堂在线亚洲视频| 国产福利一区二区三区| 欧美日韩黄色一区二区| 国产日韩欧美综合一区| 图片区小说区国产精品视频| 成人免费视频一区二区| 91精品国产欧美日韩| 亚洲人123区| 国产精品影视在线观看| 欧美二区乱c少妇| 亚洲人成7777| 成人免费视频app| 精品国产不卡一区二区三区| 亚洲高清一区二区三区| 91天堂素人约啪| 久久久久国产精品厨房| 亚洲国产中文字幕| 色诱视频网站一区| 国产人妖乱国产精品人妖| 蜜桃一区二区三区在线观看| 91福利国产精品| 亚洲天堂2014| 成人黄色a**站在线观看| 26uuu精品一区二区在线观看| 天天综合天天做天天综合| 91国偷自产一区二区三区观看 | 日本电影亚洲天堂一区| 中文字幕亚洲区| 成人性生交大片免费看视频在线 | 91视频免费播放| 亚洲欧洲www| 北条麻妃一区二区三区| 中文子幕无线码一区tr| 国产传媒欧美日韩成人| 久久久亚洲高清| 国产精品一区免费视频| 久久久午夜精品理论片中文字幕| 精彩视频一区二区三区| 久久久精品蜜桃| 成人影视亚洲图片在线| 日本一区二区免费在线观看视频|