1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
.\" Copyright (c) 2000 Andries Brouwer (aeb@cwi.nl)
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.\"
.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved.
.\" Translated Thu Fri 08 2001 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\"
.\"WORD: numeric fill character ʸ
.\"WORD: grouping character 롼ײʸ
.\"WORD: left precision
.\"WORD: right precision
.\"WORD: radix (character) (ʸ)
.\"WORD: conversion character Ѵʸ
.\"WORD: international currency format ̲ߥեޥå
.\"WORD: national currency format ̲ߥեޥå
.\"
.TH STRFMON 3 2000-12-05 "Linux" "Linux Programmer's Manual"
.SH ̾
strfmon \- ۤͤʸѴ
.SH
.B #include <monetary.h>
.sp
.BI "ssize_t strfmon(char *" s ", size_t " max ", const char *" format ,
.B "...);"
.SH
.BR strfmon ()
ؿϡꤵ줿̤
.I format
ǻꤵ줿եޥåȤˤä
̤
.I max
ʸ
.I s
˽ࡣ
.PP
.I format
̾ʸϡѴ줺ˤΤޤ
.I s
˥ԡ롣Ѵ '%' ʸǻϤޤ롣
ľˤϡʲΥե饰 0 İʾ³뤳ȤǤ롣
.TP
.BI = f
1 Хʸ
.I f
ʸ (numeric fill character) ˤ
(٤ȶѤ롣ʲ)
ꤵʤȡڡʸѤ롣
.TP
.B ^
ߤΥƤǤ롼ײʸ (grouping character)
ڻȤʤǥեȤǤϥ롼ײͭˤʤäƤ롣
.TP
.BR ( " ޤ " +
( ե饰ϡο̤ͤdz뤳Ȥ̣롣
+ ե饰ǥեȤΤ褦˼갷Ȥ̣
(ʤͤ˥ޡ֤롣
㤨ʤʤˤʤʤ "\-" ֤ʤ)
.TP
.B !
̲ߥܥά롣
.TP
.B \-
٤ƤΥեɤͤˤ롣ǥեȤϱͤᡣ
.LP
ΰ֤ˤϡեɤǤ롣
10 ʤοʸǡեɤκǾХñ̤ǻꤹ롣
ǥեȤ 0
̤ⶹʤäˤϡ
ʬڡ
(ͤե饰ꤵƤʤк¦)
.LP
ΰ֤ˤϡ"#" 10 ʿʸ³ǡ
(left precision) Ǥ롣
̲ߤδ (radix) 꺸¦οͤηλ꾮ϡ
ʸǺ¦롣
ΥեλǤϡ롼ײʸϥȤʤ
.LP
ΰ֤ˤϡ"." 10 ʿʸ³ǡ
(right precision) Ǥ롣
ͤϡˤη˴ݤ롣
ǥեȤǤϥȥ
.I frac_digits
.I int_frac_digits
λѤ롣
٤ 0 ξϡʸ (radix character) ϰʤ
(Ǥδʸ
.B LC_MONETARY
Ƥꡢ
.B LC_NUMERIC
λȤϰۤʤäƤƤ褤)
.LP
ǸˡѴѴʸ (conversion character)
ǽλʤФʤʤ
Ѵʸˤϰʲ 3 Ĥ롣
.TP
.B %
(ξϻΤ "%%" ǤʤФʤʤ)
̤ʸ '%' ʸࡣ
.TP
.B i
.I double
ΰҤȤĤ
ι̲ߥեޥå (international currency format)
ѤѴ롣
.TP
.B n
.I double
ΰҤȤĤ
ι̲ߥեޥå (national currency format)
ѤѴ롣
.SH ֤
.BR strfmon ()
ؿϡ̤ʸü NULL ХȤޤ
.I s
˼ޤäˤϡ
.I s
˽ޤ줿ʸ֤NULL ХȤʸʤ
ʳξˤϡ
.I errno
.B E2BIG
ꤷ \-1 ֤
ξƤ̤Ǥ롣
.SH
POSIX.1-2001 ˤϤʤ
¾ΤĤΥƥ¸ߤ롣
.SH
.in +4n
.nf
strfmon(buf, sizeof(buf), "[%^=*#6n] [%=*#6i]",
1234.567, 1234.567);
.fi
.in
Τ褦ʴؿνϤϡΥǤϰʲΤ褦ʽϤˤʤ롣
.in +4n
[ fl **1234,57] [ NLG **1 234,57]
.in
(fl "florijnen" ΰաNLG Netherlands Guilder)
롼ײʸѤ˽ʤ롣
Ʊ˴ְ㤤ʤθˤʤäƤޤ
ϿͤȾʬʲǤ٤
ͤƱäƤޤǤ롣
ҤɤȤˡ "fl" ˤϥڡäƤޤ
ޤ "NLG" ˤ 1 ġˤ 2 ĤΥڡ֤Ƥ롣
ϥեΥХǤ
ꥢȥꥢݥȥ
ƥǤη̤ϰʲΤ褦ˤʤ롣
.in +4n
[ L. **1235] [ ITL **1.235]
.br
[ $**1234.57] [ AUD **1,234.57]
.br
[Fr. **1234,57] [CHF **1.234,57]
.br
[ **1234$57Esc] [ **1.234$57PTE ]
.in
.SH Ϣ
.BR setlocale (3),
.BR sprintf (3),
.BR locale (7)
|