@@ -70,6 +70,10 @@ ZEND_END_ARG_INFO()
7070ZEND_BEGIN_ARG_INFO_EX (format_color_arginfo , 0 , 0 , 1 )
7171 ZEND_ARG_INFO (0 , color )
7272ZEND_END_ARG_INFO ()
73+
74+ ZEND_BEGIN_ARG_INFO_EX (format_number_arginfo , 0 , 0 , 1 )
75+ ZEND_ARG_INFO (0 , format )
76+ ZEND_END_ARG_INFO ()
7377/* }}} */
7478
7579/** {{{ \Vtiful\Kernel\Format::__construct()
@@ -179,6 +183,24 @@ PHP_METHOD(vtiful_format, color)
179183}
180184/* }}} */
181185
186+ /** {{{ \Vtiful\Kernel\Format::number(string $format)
187+ */
188+ PHP_METHOD (vtiful_format , number )
189+ {
190+ zend_string * format ;
191+
192+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
193+ Z_PARAM_STR (format )
194+ ZEND_PARSE_PARAMETERS_END ();
195+
196+ ZVAL_COPY (return_value , getThis ());
197+
198+ format_object * obj = Z_FORMAT_P (getThis ());
199+
200+ format_set_num_format (obj -> ptr .format , ZSTR_VAL (format ));
201+ }
202+ /* }}} */
203+
182204/** {{{ \Vtiful\Kernel\Format::toResource()
183205 */
184206PHP_METHOD (vtiful_format , toResource )
@@ -199,6 +221,7 @@ zend_function_entry format_methods[] = {
199221 PHP_ME (vtiful_format , underline , format_underline_arginfo , ZEND_ACC_PUBLIC )
200222 PHP_ME (vtiful_format , align , format_align_arginfo , ZEND_ACC_PUBLIC )
201223 PHP_ME (vtiful_format , color , format_color_arginfo , ZEND_ACC_PUBLIC )
224+ PHP_ME (vtiful_format , number , format_number_arginfo , ZEND_ACC_PUBLIC )
202225 PHP_ME (vtiful_format , toResource , NULL , ZEND_ACC_PUBLIC )
203226 PHP_FE_END
204227};
0 commit comments