差分
このページの2つのバージョン間の差分を表示します。
programming:mac:nsstring_format_specifiers [2013-11-01 00:16] Decomo 作成 |
programming:mac:nsstring_format_specifiers [2015-01-06 11:51] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== NSStringで使える書式指定子 ====== | ||
- | Mac OS X v10.6の「String Format Specifiers」より抜粋。 | ||
- | |||
- | ^ 指定子 | ||
- | |%@|Objective-Cオブジェクト。利用可能なら< | ||
- | |%%|' | ||
- | |%d, %D, %i|符号あり32ビット整数(int)| | ||
- | |%u, %U|符号なし32ビット整数(unsigned int)| | ||
- | |%hi|符号あり16ビット整数(short)| | ||
- | |%hu|符号なし16ビット整数(unsigned short)| | ||
- | |%qi|符号あり64ビット整数(long long)| | ||
- | |%qu|符号なし64ビット整数(unsigned long long)| | ||
- | |%x|符号なし32ビット整数(unsigned int)を16進表記。小文字のa〜fを用いる。| | ||
- | |%X|符号なし32ビット整数(unsigned int)を16進表記。大文字のA〜Fを用いる。| | ||
- | |%qx|符号なし64ビット整数(unsigned int)を16進表記。小文字のa〜fを用いる。| | ||
- | |%qX|符号なし64ビット整数(unsigned int)を16進表記。大文字のA〜Fを用いる。| | ||
- | |%o, %O|符号なし32ビット整数(unsigned int)を8進表記。| | ||
- | |%f|64ビット浮動小数点値(double)| | ||
- | |%e|64ビット浮動小数点値(double)を指数表記。指数文字は小文字のeを用いる。| | ||
- | |%E|64ビット浮動小数点値(double)を指数表記。指数文字は大文字のEを用いる。| | ||
- | |%g|64-bit floating-point number (double), printed in the style of %e if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise| | ||
- | |%G|64-bit floating-point number (double), printed in the style of %E if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise| | ||
- | |%c|8ビット符号なし文字(unsigned char)。< | ||
- | |%C|16ビットUnicode文字(unichar)。< | ||
- | |%s|NULL終端の8ビット符号なし文字配列。%s interprets its input in the system encoding rather than, for example, UTF-8.| | ||
- | |%S|NULL終端の16ビットUnicode文字配列。| | ||
- | |%p|voidポインタ(void *)。0xに続く16進表記。小文字のa〜fを用いる。| | ||
- | |%L|長さ修飾子。a, | ||
- | |%a|64-bit floating-point number (double), printed in scientific notation with a leading 0x and one hexadecimal digit before the decimal point using a lowercase p to introduce the exponent| | ||
- | |%A|64-bit floating-point number (double), printed in scientific notation with a leading 0X and one hexadecimal digit before the decimal point using a uppercase P to introduce the exponent| | ||
- | |%F|64-bit floating-point number (double), printed in decimal notation| | ||
- | |%z|Length modifier specifying that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument| | ||
- | |%t|Length modifier specifying that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned integer type argument| | ||
- | |%j|Length modifier specifying that a following d, i, o, u, x, or X conversion specifier applies to a intmax_t or uintmax_t argument| |