当前位置: 首页>>代码示例>>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()
 {
     // 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:Kiranj1992,项目名称:PHPExcel,代码行数:57,代码来源:NumberFormat.php

示例2: builtInFormatCode

    /**
     * Get built-in format code
     *
     * @param	int		$pIndex
     * @return	string
     */
    public static function builtInFormatCode($pIndex) {
    	// Clean parameter
		$pIndex = intval($pIndex);

    	// Built-in format codes
    	if (is_null(self::$_builtInFormats)) {
			self::$_builtInFormats = array();

			// General
			self::$_builtInFormats[0] = '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[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# ??/??';
    	}

		if (array_key_exists($pIndex, self::$_builtInFormats)) {
			return self::$_builtInFormats[$pIndex];
		}

    	return '';
    }
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:68,代码来源:NumberFormat.php


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