当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_Style_NumberFormat::builtInFormats方法代码示例

本文整理汇总了PHP中PHPExcel_Style_NumberFormat::builtInFormats方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Style_NumberFormat::builtInFormats方法的具体用法?PHP PHPExcel_Style_NumberFormat::builtInFormats怎么用?PHP PHPExcel_Style_NumberFormat::builtInFormats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_Style_NumberFormat的用法示例。


在下文中一共展示了PHPExcel_Style_NumberFormat::builtInFormats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fillBuiltInFormatCodes

 /**
  * Fill built-in format codes
  */
 private static function fillBuiltInFormatCodes()
 {
     //  [MS-OI29500: Microsoft Office Implementation Information for ISO/IEC-29500 Standard Compliance]
     //  18.8.30. numFmt (Number Format)
     //
     //  The ECMA standard defines built-in format IDs
     //      14: "mm-dd-yy"
     //      22: "m/d/yy h:mm"
     //      37: "#,##0 ;(#,##0)"
     //      38: "#,##0 ;[Red](#,##0)"
     //      39: "#,##0.00;(#,##0.00)"
     //      40: "#,##0.00;[Red](#,##0.00)"
     //      47: "mmss.0"
     //      KOR fmt 55: "yyyy-mm-dd"
     //  Excel defines built-in format IDs
     //      14: "m/d/yyyy"
     //      22: "m/d/yyyy h:mm"
     //      37: "#,##0_);(#,##0)"
     //      38: "#,##0_);[Red](#,##0)"
     //      39: "#,##0.00_);(#,##0.00)"
     //      40: "#,##0.00_);[Red](#,##0.00)"
     //      47: "mm:ss.0"
     //      KOR fmt 55: "yyyy/mm/dd"
     // Built-in format codes
     if (is_null(self::$builtInFormats)) {
         self::$builtInFormats = array();
         // General
         self::$builtInFormats[0] = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
         self::$builtInFormats[1] = '0';
         self::$builtInFormats[2] = '0.00';
         self::$builtInFormats[3] = '#,##0';
         self::$builtInFormats[4] = '#,##0.00';
         self::$builtInFormats[9] = '0%';
         self::$builtInFormats[10] = '0.00%';
         self::$builtInFormats[11] = '0.00E+00';
         self::$builtInFormats[12] = '# ?/?';
         self::$builtInFormats[13] = '# ??/??';
         self::$builtInFormats[14] = 'm/d/yyyy';
         // Despite ECMA 'mm-dd-yy';
         self::$builtInFormats[15] = 'd-mmm-yy';
         self::$builtInFormats[16] = 'd-mmm';
         self::$builtInFormats[17] = 'mmm-yy';
         self::$builtInFormats[18] = 'h:mm AM/PM';
         self::$builtInFormats[19] = 'h:mm:ss AM/PM';
         self::$builtInFormats[20] = 'h:mm';
         self::$builtInFormats[21] = 'h:mm:ss';
         self::$builtInFormats[22] = 'm/d/yyyy h:mm';
         // Despite ECMA 'm/d/yy h:mm';
         self::$builtInFormats[37] = '#,##0_);(#,##0)';
         //  Despite ECMA '#,##0 ;(#,##0)';
         self::$builtInFormats[38] = '#,##0_);[Red](#,##0)';
         //  Despite ECMA '#,##0 ;[Red](#,##0)';
         self::$builtInFormats[39] = '#,##0.00_);(#,##0.00)';
         //  Despite ECMA '#,##0.00;(#,##0.00)';
         self::$builtInFormats[40] = '#,##0.00_);[Red](#,##0.00)';
         //  Despite ECMA '#,##0.00;[Red](#,##0.00)';
         self::$builtInFormats[44] = '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)';
         self::$builtInFormats[45] = 'mm:ss';
         self::$builtInFormats[46] = '[h]:mm:ss';
         self::$builtInFormats[47] = 'mm:ss.0';
         //  Despite ECMA 'mmss.0';
         self::$builtInFormats[48] = '##0.0E+0';
         self::$builtInFormats[49] = '@';
         // CHT
         self::$builtInFormats[27] = '[$-404]e/m/d';
         self::$builtInFormats[30] = 'm/d/yy';
         self::$builtInFormats[36] = '[$-404]e/m/d';
         self::$builtInFormats[50] = '[$-404]e/m/d';
         self::$builtInFormats[57] = '[$-404]e/m/d';
         // THA
         self::$builtInFormats[59] = 't0';
         self::$builtInFormats[60] = 't0.00';
         self::$builtInFormats[61] = 't#,##0';
         self::$builtInFormats[62] = 't#,##0.00';
         self::$builtInFormats[67] = 't0%';
         self::$builtInFormats[68] = 't0.00%';
         self::$builtInFormats[69] = 't# ?/?';
         self::$builtInFormats[70] = 't# ??/??';
         // Flip array (for faster lookups)
         self::$flippedBuiltInFormats = array_flip(self::$builtInFormats);
     }
 }
开发者ID:ambagasdowa,项目名称:kml,代码行数:85,代码来源:NumberFormat.php

示例2: fillBuiltInFormatCodes

 /**
  * Fill built-in format codes
  */
 private static function fillBuiltInFormatCodes()
 {
     // Built-in format codes
     if (is_null(self::$builtInFormats)) {
         self::$builtInFormats = array();
         // General
         self::$builtInFormats[0] = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
         self::$builtInFormats[1] = '0';
         self::$builtInFormats[2] = '0.00';
         self::$builtInFormats[3] = '#,##0';
         self::$builtInFormats[4] = '#,##0.00';
         self::$builtInFormats[9] = '0%';
         self::$builtInFormats[10] = '0.00%';
         self::$builtInFormats[11] = '0.00E+00';
         self::$builtInFormats[12] = '# ?/?';
         self::$builtInFormats[13] = '# ??/??';
         self::$builtInFormats[14] = 'mm-dd-yy';
         self::$builtInFormats[15] = 'd-mmm-yy';
         self::$builtInFormats[16] = 'd-mmm';
         self::$builtInFormats[17] = 'mmm-yy';
         self::$builtInFormats[18] = 'h:mm AM/PM';
         self::$builtInFormats[19] = 'h:mm:ss AM/PM';
         self::$builtInFormats[20] = 'h:mm';
         self::$builtInFormats[21] = 'h:mm:ss';
         self::$builtInFormats[22] = 'm/d/yy h:mm';
         self::$builtInFormats[37] = '#,##0 ;(#,##0)';
         self::$builtInFormats[38] = '#,##0 ;[Red](#,##0)';
         self::$builtInFormats[39] = '#,##0.00;(#,##0.00)';
         self::$builtInFormats[40] = '#,##0.00;[Red](#,##0.00)';
         self::$builtInFormats[44] = '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)';
         self::$builtInFormats[45] = 'mm:ss';
         self::$builtInFormats[46] = '[h]:mm:ss';
         self::$builtInFormats[47] = 'mmss.0';
         self::$builtInFormats[48] = '##0.0E+0';
         self::$builtInFormats[49] = '@';
         // CHT
         self::$builtInFormats[27] = '[$-404]e/m/d';
         self::$builtInFormats[30] = 'm/d/yy';
         self::$builtInFormats[36] = '[$-404]e/m/d';
         self::$builtInFormats[50] = '[$-404]e/m/d';
         self::$builtInFormats[57] = '[$-404]e/m/d';
         // THA
         self::$builtInFormats[59] = 't0';
         self::$builtInFormats[60] = 't0.00';
         self::$builtInFormats[61] = 't#,##0';
         self::$builtInFormats[62] = 't#,##0.00';
         self::$builtInFormats[67] = 't0%';
         self::$builtInFormats[68] = 't0.00%';
         self::$builtInFormats[69] = 't# ?/?';
         self::$builtInFormats[70] = 't# ??/??';
         // Flip array (for faster lookups)
         self::$flippedBuiltInFormats = array_flip(self::$builtInFormats);
     }
 }
开发者ID:oalkhanishvili,项目名称:track2,代码行数:57,代码来源:NumberFormat.php


注:本文中的PHPExcel_Style_NumberFormat::builtInFormats方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。