summaryrefslogtreecommitdiffstats
path: root/scilab/modules
diff options
context:
space:
mode:
authorSamuel GOUGEON <sgougeon@free.fr>2021-04-12 15:01:32 +0200
committerClément David <clement.david@esi-group.com>2021-04-12 17:32:54 +0200
commitf29166d9ca1f7a7a56047c16cc40d095bc251c0b (patch)
tree279c7ecaa14ca1b2283291e9589f7bbb18edefd8 /scilab/modules
parent384754bcc6eadd9c5f91f49d23b6750d5285c6f2 (diff)
downloadscilab-f29166d9ca1f7a7a56047c16cc40d095bc251c0b.zip
scilab-f29166d9ca1f7a7a56047c16cc40d095bc251c0b.tar.gz
[doc] gettext printf_conversion mprintf msprintf mfprintf pages updated & fixed
* update for numbered placeholders "%n$" * update for boolean input * printf_conversion fixed for many issues (see changes), and a lot improved. I think that when processing the bug http://bugzilla.scilab.org/5511 10 years ago, the uploaded XML were not the right ones: there were so many issues left... (or i was more lazy :-/ ) Bundled PDF: http://bugzilla.scilab.org/attachment.cgi?id=5260 Change-Id: I755f6fa53140e3a357a55188d16ff36288c1fc8f
Diffstat (limited to 'scilab/modules')
-rw-r--r--scilab/modules/fileio/help/en_US/mfprintf.xml166
-rw-r--r--scilab/modules/fileio/help/ja_JP/mfprintf.xml308
-rw-r--r--scilab/modules/fileio/help/ru_RU/mfprintf.xml152
-rw-r--r--scilab/modules/localization/help/en_US/gettext.xml134
-rw-r--r--scilab/modules/localization/help/ru_RU/gettext.xml122
-rw-r--r--scilab/modules/output_stream/help/en_US/mprintf.xml123
-rw-r--r--scilab/modules/output_stream/help/en_US/msprintf.xml134
-rw-r--r--scilab/modules/output_stream/help/en_US/printf_conversion.xml433
-rw-r--r--scilab/modules/output_stream/help/ja_JP/mprintf.xml112
-rw-r--r--scilab/modules/output_stream/help/ja_JP/msprintf.xml90
-rw-r--r--scilab/modules/output_stream/help/ja_JP/printf_conversion.xml400
-rw-r--r--scilab/modules/output_stream/help/pt_BR/printf_conversion.xml538
12 files changed, 1622 insertions, 1090 deletions
diff --git a/scilab/modules/fileio/help/en_US/mfprintf.xml b/scilab/modules/fileio/help/en_US/mfprintf.xml
index 3c10edc..6187b63 100644
--- a/scilab/modules/fileio/help/en_US/mfprintf.xml
+++ b/scilab/modules/fileio/help/en_US/mfprintf.xml
@@ -3,8 +3,8 @@
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA 4 * Copyright (C) 2008 - INRIA
5 * ... 5 * ...
6 *
7 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * Copyright (C) 2021 - Samuel GOUGEON
8 * 8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0, 9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1. 10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -14,14 +14,17 @@
14 * along with this program. 14 * along with this program.
15 * 15 *
16 --> 16 -->
17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="mfprintf" xml:lang="en"> 17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
19 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
20 xmlns:scilab="http://www.scilab.org" xml:id="mfprintf" xml:lang="en">
18 <refnamediv> 21 <refnamediv>
19 <refname>mfprintf</refname> 22 <refname>mfprintf</refname>
20 <refpurpose>converts, formats, and writes data to a file</refpurpose> 23 <refpurpose>converts, formats, and writes data to a file</refpurpose>
21 </refnamediv> 24 </refnamediv>
22 <refsynopsisdiv> 25 <refsynopsisdiv>
23 <title>Syntax</title> 26 <title>Syntax</title>
24 <synopsis>mfprintf(fd, format, a1, ..., an);</synopsis> 27 <synopsis>mfprintf(fd, format, a1, ..., an)</synopsis>
25 </refsynopsisdiv> 28 </refsynopsisdiv>
26 <refsection> 29 <refsection>
27 <title>Arguments</title> 30 <title>Arguments</title>
@@ -30,14 +33,13 @@
30 <term>fd</term> 33 <term>fd</term>
31 <listitem> 34 <listitem>
32 <para> 35 <para>
33 a scalar, file descriptor given by <function>mopen</function> 36 scalar positive index identifying the file, as provided by <literal>mopen</literal>.
34 (it's a positive integer).
35 </para> 37 </para>
36 <para> 38 <para>
37 If <varname>fd</varname> equals 0 redirection in stderr. 39 If <varname>fd</varname> equals 0: redirection to stderr.
38 </para> 40 </para>
39 <para> 41 <para>
40 If <varname>fd</varname> equals 6 redirection in stdout. 42 If <varname>fd</varname> equals 6: redirection to stdout (console).
41 </para> 43 </para>
42 <para> 44 <para>
43 OBSOLETE: The value <literal>-1</literal> refers to the 45 OBSOLETE: The value <literal>-1</literal> refers to the
@@ -49,33 +51,24 @@
49 <term>format</term> 51 <term>format</term>
50 <listitem> 52 <listitem>
51 <para> 53 <para>
52 a Scilab string describing the format to use to write the 54 a string providing the format to use to write all next arguments.
53 remaining operands. The 55 The <varname>format</varname> follows -- as close as possible -- the C printf
54 <varname> 56 format operand syntax, as described in the
55 format 57 <link linkend="printf_conversion">printf_conversion</link> page.
56 </varname> 58 UTF-8 extended characters are supported.
57 operand follows, 59 <warning>
58 as close as possible, the C 60 Numbered placeholders "%n$.." are not supported.
59 <function> 61 </warning>
60 printf
61 </function>
62 format
63 operand syntax.
64 </para> 62 </para>
65 </listitem> 63 </listitem>
66 </varlistentry> 64 </varlistentry>
67 <varlistentry> 65 <varlistentry>
68 <term>str</term>
69 <listitem>
70 <para>a character string: a string to be scanned.</para>
71 </listitem>
72 </varlistentry>
73 <varlistentry>
74 <term>a1, ..., an</term> 66 <term>a1, ..., an</term>
75 <listitem> 67 <listitem>
76 <para> 68 <para>
77 the data to be converted and printed according to 69 Data to be converted and written according to the <varname>format</varname>
78 the format parameter. 70 argument. Supported types: all numbers, booleans, strings. Only the real part
71 of complex numbers is considered (current Scilab limitation).
79 </para> 72 </para>
80 </listitem> 73 </listitem>
81 </varlistentry> 74 </varlistentry>
@@ -84,30 +77,31 @@
84 <refsection> 77 <refsection>
85 <title>Description</title> 78 <title>Description</title>
86 <para> 79 <para>
87 The <function>mfprintf</function> function is a interface for C-coded 80 <literal>mfprintf(fd, format, a1, a2, ..)</literal> replaces placeholders provided
88 version of <function>fprintf</function> function. 81 in the <varname>format</varname> string with values of <varname>a1</varname>,
82 <varname>a2</varname>, .. converted according to each respective placeholder directive,
83 and writes the result to the file specified by its index <varname>fd</varname>.
89 </para> 84 </para>
90 <para> 85 <para>
91 The <function>mfprintf</function> function writes formatted operands 86 If <varname>a1</varname>, <varname>a2</varname>, .. are arrays with multiple rows,
92 to the file specified by the file descriptor <varname>fd</varname>. The 87 they feed the format row by row: the format is used iteratively for every row of the
93 argument operands are formatted under control of the 88 (horizontally "concatenated") arrays, until the bottom
94 <varname>format</varname> operand. 89 of the least tall array is reached. Remaining rows of taller arrays (if any) are ignored.
90 See examples.
95 </para> 91 </para>
96 <para> 92 <para>
97 This function may be used to output column vectors of numbers 93 If the total number of columns of <varname>a1</varname>, <varname>a2</varname>, ..
98 and string vectors without an explicit loop on the elements. In that 94 is bigger than the number of placeholders in the <varname>format</varname>,
99 case this function iterates on the rows. The shortest vector gives the 95 then extra columns are ignored. If it is smaller, an error is yielded.
100 number of time the format has to be iterated.
101 </para> 96 </para>
102 <para> 97 <para>
103 An homogeneous sequence of identical type parameters can be replaced 98 The <literal>mfprintf</literal> function is a interface for C-coded
104 by a matrix. 99 <literal>fprintf</literal> function.
105 </para> 100 </para>
106 </refsection> 101 </refsection>
107 <refsection> 102 <refsection>
108 <title>Examples</title> 103 <title>Examples</title>
109 <programlisting role="example"><![CDATA[ 104 <programlisting role="example"><![CDATA[
110
111fd = mopen(TMPDIR+'/text.txt','wt'); 105fd = mopen(TMPDIR+'/text.txt','wt');
112mfprintf(fd,'hello %s %d.\n','world',1); 106mfprintf(fd,'hello %s %d.\n','world',1);
113mfprintf(fd,'hello %s %d.\n','scilab',2); 107mfprintf(fd,'hello %s %d.\n','scilab',2);
@@ -116,61 +110,99 @@ mfprintf(fd,'This line is built with a row vector (26:28) %d.\n',[26:28]);
116A = rand(3,6); 110A = rand(3,6);
117mfprintf(fd,'This line is built with a matrix %.3f.\n',A); 111mfprintf(fd,'This line is built with a matrix %.3f.\n',A);
118mclose(fd); 112mclose(fd);
119if (isdef('editor') | (funptr('editor')<>0)) then 113editor(TMPDIR+'/text.txt')
120 editor(TMPDIR+'/text.txt') 114
121end
122mfprintf(0,'stderr output.\n'); 115mfprintf(0,'stderr output.\n');
123mfprintf(6,'stdout output.\n'); 116mfprintf(6,'stdout output.\n');
124 ]]></programlisting> 117 ]]></programlisting>
118 <para/>
119 <programlisting role="example"><![CDATA[
120I = (1:4)';
121A = [26.93 ; 63.25 ; 40.51 ; 91.84];
122B = [ 3.62 ; 15.04 ; 25.3 ; 48.19];
123C = [ 4.37 28.06
124 48.18 %inf
125 41.48 %nan
126 26.39 77.83];
127Status = ["NOK" "NOK" "NOK" "OK"]';
128Format = "Iteration %d: Results: A= %f B= %2d%% Status= %3s C(1)= %g C(2)= %e\n";
129File = TMPDIR + "/mfprintf.txt";
130fd = mopen(File, 'wt');
131mfprintf(fd, Format, I, A, B, Status, C);
132mclose
133editor(File)
134 ]]></programlisting>
135 <screen><![CDATA[
136Iteration 1: Results: A= 26.930000 B= 3% Status= NOK C(1)= 4.37 C(2)= 2.806000e+01
137Iteration 2: Results: A= 63.250000 B= 15% Status= NOK C(1)= 48.18 C(2)= Inf
138Iteration 3: Results: A= 40.510000 B= 25% Status= NOK C(1)= 41.48 C(2)= Nan
139Iteration 4: Results: A= 91.840000 B= 48% Status= OK C(1)= 26.39 C(2)= 7.783000e+01
140]]></screen>
141 <para/>
142 <para>
143 Supernumerary columns or rows are ignored:
144 </para>
145 <programlisting role="example"><![CDATA[
146A = [%T %F %T %T %F]';
147B = [ 4.37 28.06
148 48.18 %inf
149 41.48 %nan ];
150File = TMPDIR + "/mfprintf.txt";
151fd = mopen(File, 'wt');
152mfprintf(fd, "OK? %s Value: %4.1f\n", A, B)
153mclose
154editor(File)
155 ]]></programlisting>
156 <screen><![CDATA[
157OK? T Value: 4.4
158OK? F Value: 48.2
159OK? T Value: 41.5
160]]></screen>
125 </refsection> 161 </refsection>
126 <refsection role="see also"> 162 <refsection role="see also">
127 <title>See also</title> 163 <title>See also</title>
128 <simplelist type="inline"> 164 <simplelist type="inline">
129 <member> 165 <member>
130 <link linkend="mclose">mclose</link> 166 <link linkend="printf_conversion">printf_conversion</link>
131 </member> 167 </member>
132 <member> 168 <member>
133 <link linkend="meof">meof</link> 169 <link linkend="csvWrite">csvWrite</link>
134 </member> 170 </member>
135 <member> 171 <member>
136 <link linkend="fprintfMat">fprintfMat</link> 172 <link linkend="fprintfMat">fprintfMat</link>
137 </member> 173 </member>
138 <member> 174 <member>
139 <link linkend="mfscanf">mfscanf</link> 175 <link linkend="write">write</link>
140 </member>
141 <member>
142 <link linkend="fscanfMat">fscanfMat</link>
143 </member>
144 <member>
145 <link linkend="mget">mget</link>
146 </member>
147 <member>
148 <link linkend="mgetstr">mgetstr</link>
149 </member>
150 <member>
151 <link linkend="mopen">mopen</link>
152 </member> 176 </member>
153 <member> 177 <member>
154 <link linkend="mprintf">mprintf</link> 178 <link linkend="mputl">mputl</link>
155 </member>
156 <member>
157 <link linkend="mput">mput</link>
158 </member> 179 </member>
159 <member> 180 <member>
160 <link linkend="mputstr">mputstr</link> 181 <link linkend="mputstr">mputstr</link>
161 </member> 182 </member>
162 <member> 183 <member>
163 <link linkend="mseek">mseek</link> 184 <link linkend="mopen">mopen</link>
164 </member> 185 </member>
165 <member> 186 <member>
166 <link linkend="mtell">mtell</link> 187 <link linkend="mclose">mclose</link>
167 </member> 188 </member>
168 <member> 189 <member>
169 <link linkend="mdelete">mdelete</link> 190 <link linkend="mprintf">msprintf</link>
170 </member> 191 </member>
171 <member> 192 <member>
172 <link linkend="printf_conversion">printf_conversion</link> 193 <link linkend="mfscanf">mfscanf</link>
173 </member> 194 </member>
174 </simplelist> 195 </simplelist>
175 </refsection> 196 </refsection>
197 <refsection role="history">
198 <title>History</title>
199 <revhistory>
200 <revision>
201 <revnumber>6.1.1</revnumber>
202 <revdescription>
203 Input data can be boolean.
204 </revdescription>
205 </revision>
206 </revhistory>
207 </refsection>
176</refentry> 208</refentry>
diff --git a/scilab/modules/fileio/help/ja_JP/mfprintf.xml b/scilab/modules/fileio/help/ja_JP/mfprintf.xml
deleted file mode 100644
index 8ac9de2..0000000
--- a/scilab/modules/fileio/help/ja_JP/mfprintf.xml
+++ /dev/null
@@ -1,308 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5 * Copyright (C) 2008 - INRIA
6 * ...
7 *
8 * Copyright (C) 2012 - 2016 - Scilab Enterprises
9 *
10 * This file is hereby licensed under the terms of the GNU GPL v2.0,
11 * pursuant to article 5.3.4 of the CeCILL v.2.1.
12 * This file was originally licensed under the terms of the CeCILL v2.1,
13 * and continues to be available under such terms.
14 * For more information, see the COPYING file which you should have received
15 * along with this program.
16 *
17 -->
18
19<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="mfprintf" xml:lang="ja">
20
21 <refnamediv>
22
23 <refname>mfprintf</refname>
24
25 <refpurpose>変換,整形し,ファイルにデータを書き込む</refpurpose>
26
27 </refnamediv>
28
29 <refsynopsisdiv>
30
31 <title>呼び出し手順</title>
32
33 <synopsis>mfprintf(fd, format, a1, ..., an);</synopsis>
34
35 </refsynopsisdiv>
36
37 <refsection>
38
39 <title>引数</title>
40
41 <variablelist>
42
43 <varlistentry>
44
45 <term>fd</term>
46
47 <listitem>
48
49 <para>
50
51 スカラー, <function>mopen</function>で指定したファイル記述子
52
53 (正の整数).
54
55 </para>
56
57 <para>
58
59 <varname>fd</varname> が 0 の場合, stderr へのリダイレクション.
60
61 </para>
62
63 <para>
64
65 <varname>fd</varname>が 6 の場合, stdout へのリダイレクション.
66
67 </para>
68
69 <para>
70
71 古い仕様 :値 <literal>-1</literal> はデフォルトのファイル
72
73 ( すなわち直近にオープンされたファイル)を指します.
74
75 </para>
76
77 </listitem>
78
79 </varlistentry>
80
81 <varlistentry>
82
83 <term>format</term>
84
85 <listitem>
86
87 <para>
88
89 残りのオペランドを書き込む際に使用されるフォーマットを指定する
90
91 Scilab 文字列.
92
93 <varname>format</varname>オペランドはCの<function>printf</function>
94
95 のフォーマットオペランドの構文に可能な限り似せられています.
96
97 </para>
98
99 </listitem>
100
101 </varlistentry>
102
103 <varlistentry>
104
105 <term>str</term>
106
107 <listitem>
108
109 <para>文字列: スキャンされる文字列.</para>
110
111 </listitem>
112
113 </varlistentry>
114
115 <varlistentry>
116
117 <term>a1, ..., an</term>
118
119 <listitem>
120
121 <para>
122
123 formatパラメータに基づき変換,出力されるデータ.
124
125 </para>
126
127 </listitem>
128
129 </varlistentry>
130
131 </variablelist>
132
133 </refsection>
134
135 <refsection>
136
137 <title>説明</title>
138
139 <para>
140
141 <function>mfprintf</function> 関数は, C言語の<function>fprintf</function>関数への
142
143 インターフェイスです.
144
145 </para>
146
147 <para>
148
149 <function>mfprintf</function>関数は,整形されたオペランドを
150
151 ファイル記述子<varname>fd</varname>で指定したファイルに書き込みます.
152
153 引数のオペランドは,<varname>format</varname>オペランドの制御のもとで整形されます.
154
155 </para>
156
157 <para>
158
159 この関数は数値の列ベクトルおよび文字列ベクトルを要素に関する
160
161 明示的なループ処理を行うことなく出力する際に使用することができます.
162
163 この場合,この関数は行に関する反復処理を行ないます.
164
165 最も短いベクトルはフォーマットの反復回数を指定します.
166
167 </para>
168
169 <para>
170
171 同じ型パラメータの一様なシーケンスは
172
173 行列で置換することができます.
174
175 </para>
176
177 </refsection>
178
179 <refsection>
180
181 <title>例</title>
182
183 <programlisting role="example"><![CDATA[
184fd = mopen(TMPDIR+'/text.txt','wt');
185mfprintf(fd,'hello %s %d.\n','world',1);
186mfprintf(fd,'hello %s %d.\n','scilab',2);
187mfprintf(fd,'This line is built with a column vector (26:28) %d.\n',[26:28].');
188mfprintf(fd,'This line is built with a row vector (26:28) %d.\n',[26:28]);
189A = rand(3,6);
190mfprintf(fd,'This line is built with a matrix %.3f.\n',A);
191mclose(fd);
192if (isdef('editor') | (funptr('editor')<>0)) then
193 editor(TMPDIR+'/text.txt')
194end
195mfprintf(0,'stderr output.\n');
196mfprintf(6,'stdout output.\n');
197 ]]></programlisting>
198
199 </refsection>
200
201 <refsection>
202
203 <title>参照</title>
204
205 <simplelist type="inline">
206
207 <member>
208
209 <link linkend="mclose">mclose</link>
210
211 </member>
212
213 <member>
214
215 <link linkend="meof">meof</link>
216
217 </member>
218
219 <member>
220
221 <link linkend="fprintfMat">fprintfMat</link>
222
223 </member>
224
225 <member>
226
227 <link linkend="mfscanf">mfscanf</link>
228
229 </member>
230
231 <member>
232
233 <link linkend="fscanfMat">fscanfMat</link>
234
235 </member>
236
237 <member>
238
239 <link linkend="mget">mget</link>
240
241 </member>
242
243 <member>
244
245 <link linkend="mgetstr">mgetstr</link>
246
247 </member>
248
249 <member>
250
251 <link linkend="mopen">mopen</link>
252
253 </member>
254
255 <member>
256
257 <link linkend="mprintf">mprintf</link>
258
259 </member>
260
261 <member>
262
263 <link linkend="mput">mput</link>
264
265 </member>
266
267 <member>
268
269 <link linkend="mputstr">mputstr</link>
270
271 </member>
272
273 <member>
274
275 <link linkend="mscanf">mscanf</link>
276
277 </member>
278
279 <member>
280
281 <link linkend="mseek">mseek</link>
282
283 </member>
284
285 <member>
286
287 <link linkend="mtell">mtell</link>
288
289 </member>
290
291 <member>
292
293 <link linkend="mdelete">mdelete</link>
294
295 </member>
296
297 <member>
298
299 <link linkend="printf_conversion">printf_conversion</link>
300
301 </member>
302
303 </simplelist>
304
305 </refsection>
306
307</refentry>
308
diff --git a/scilab/modules/fileio/help/ru_RU/mfprintf.xml b/scilab/modules/fileio/help/ru_RU/mfprintf.xml
index 6d9ed77..a6a844d 100644
--- a/scilab/modules/fileio/help/ru_RU/mfprintf.xml
+++ b/scilab/modules/fileio/help/ru_RU/mfprintf.xml
@@ -3,8 +3,8 @@
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA 4 * Copyright (C) 2008 - INRIA
5 * ... 5 * ...
6 *
7 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * Copyright (C) 2021 - Samuel GOUGEON
8 * 8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0, 9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1. 10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -14,14 +14,17 @@
14 * along with this program. 14 * along with this program.
15 * 15 *
16 --> 16 -->
17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="mfprintf" xml:lang="ru"> 17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
19 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
20 xmlns:scilab="http://www.scilab.org" xml:id="mfprintf" xml:lang="ru">
18 <refnamediv> 21 <refnamediv>
19 <refname>mfprintf</refname> 22 <refname>mfprintf</refname>
20 <refpurpose>преобразует, форматирует и записывает данные в файл</refpurpose> 23 <refpurpose>преобразует, форматирует и записывает данные в файл</refpurpose>
21 </refnamediv> 24 </refnamediv>
22 <refsynopsisdiv> 25 <refsynopsisdiv>
23 <title>Синтаксис</title> 26 <title>Синтаксис</title>
24 <synopsis>mfprintf(fd, format, a1, ..., an);</synopsis> 27 <synopsis>mfprintf(fd, format, a1, ..., an)</synopsis>
25 </refsynopsisdiv> 28 </refsynopsisdiv>
26 <refsection> 29 <refsection>
27 <title>Аргументы</title> 30 <title>Аргументы</title>
@@ -31,7 +34,7 @@
31 <listitem> 34 <listitem>
32 <para> 35 <para>
33 скаляр, файловый дескриптор, предоставленный с помощью 36 скаляр, файловый дескриптор, предоставленный с помощью
34 <function>mopen</function> (это положительное число). 37 <literal>mopen</literal> (это положительное число).
35 </para> 38 </para>
36 <para> 39 <para>
37 Если <varname>fd</varname> равен 0, то перенаправление в 40 Если <varname>fd</varname> равен 0, то перенаправление в
@@ -51,18 +54,14 @@
51 <term>format</term> 54 <term>format</term>
52 <listitem> 55 <listitem>
53 <para> 56 <para>
54 Scilab-строка, описывающая формат, который нужно использовать для 57 a string providing the format to use to write all next arguments.
55 записи оставшихся операндов. Операнд <varname>format</varname> 58 The <varname>format</varname> follows -- as close as possible -- the C printf
56 следует как можно ближе к синтаксису операндов формата 59 format operand syntax, as described in the
57 <function>printf</function> в языке C. 60 <link linkend="printf_conversion">printf_conversion</link> page.
58 </para> 61 UTF-8 extended characters are supported.
59 </listitem> 62 <warning>
60 </varlistentry> 63 Numbered placeholders "%n$.." are not supported.
61 <varlistentry> 64 </warning>
62 <term>str</term>
63 <listitem>
64 <para>
65 символьная строка: строка, которую нужно отсканировать.
66 </para> 65 </para>
67 </listitem> 66 </listitem>
68 </varlistentry> 67 </varlistentry>
@@ -70,7 +69,9 @@
70 <term>a1, ..., an</term> 69 <term>a1, ..., an</term>
71 <listitem> 70 <listitem>
72 <para> 71 <para>
73 данные, которые преобразуются и распечатываются в соответствии с параметром формата. 72 Data to be converted and written according to the <varname>format</varname>
73 argument. Supported types: all numbers, booleans, strings. Only the real part
74 of complex numbers is considered (current Scilab limitation).
74 </para> 75 </para>
75 </listitem> 76 </listitem>
76 </varlistentry> 77 </varlistentry>
@@ -79,28 +80,30 @@
79 <refsection> 80 <refsection>
80 <title>Описание</title> 81 <title>Описание</title>
81 <para> 82 <para>
82 Функция <function>mfprintf</function> является интерфейсом для версии функции <function>fprintf</function> на языке C. 83 <literal>mfprintf(fd, format, a1, a2, ..)</literal> replaces placeholders provided
84 in the <varname>format</varname> string with values of <varname>a1</varname>,
85 <varname>a2</varname>, .. converted according to each respective placeholder directive,
86 and writes the result to the file specified by its index <varname>fd</varname>.
83 </para> 87 </para>
84 <para> 88 <para>
85 Функция <function>mfprintf</function> записывает форматированные 89 If <varname>a1</varname>, <varname>a2</varname>, .. are arrays with multiple rows,
86 операнды в файл, указанный файловым дескриптором <varname>fd</varname>. 90 they feed the format row by row: the format is used iteratively for every row of the
87 Операнды аргумента форматируются по управлением операнда 91 (horizontally "concatenated") arrays, until the bottom
88 <varname>format</varname>. 92 of the least tall array is reached. Remaining rows of taller arrays (if any) are ignored.
93 See examples.
89 </para> 94 </para>
90 <para> 95 <para>
91 Эта функция может быть использована для вывода векторов-столбцов чисел и 96 If the total number of columns of <varname>a1</varname>, <varname>a2</varname>, ..
92 строковых векторов без явных циклов по элементам. В этом случае функция 97 is bigger than the number of placeholders in the <varname>format</varname>,
93 проводит итерации по строкам. Наиболее короткий вектор даёт количество раз, сколько формат будет повторён. 98 then extra columns are ignored. If it is smaller, an error is yielded.
94 </para> 99 </para>
95 <para> 100 <para>
96 Однородная последовательность параметров одинакового типа может быть 101 Функция <literal>mfprintf</literal> является интерфейсом для версии функции <literal>fprintf</literal> на языке C.
97 заменена матрицей.
98 </para> 102 </para>
99 </refsection> 103 </refsection>
100 <refsection> 104 <refsection>
101 <title>Примеры</title> 105 <title>Примеры</title>
102 <programlisting role="example"><![CDATA[ 106 <programlisting role="example"><![CDATA[
103
104fd = mopen(TMPDIR+'/text.txt','wt'); 107fd = mopen(TMPDIR+'/text.txt','wt');
105mfprintf(fd,'Привет, %s %d.\n','мир!',1); 108mfprintf(fd,'Привет, %s %d.\n','мир!',1);
106mfprintf(fd,'Привет, %s %d.\n','Scilab',2); 109mfprintf(fd,'Привет, %s %d.\n','Scilab',2);
@@ -109,62 +112,99 @@ mfprintf(fd,'Эта строка построена с помощью векто
109A = rand(3,6); 112A = rand(3,6);
110mfprintf(fd,'Эта строка построена с помощью матрицы %.3f.\n',A); 113mfprintf(fd,'Эта строка построена с помощью матрицы %.3f.\n',A);
111mclose(fd); 114mclose(fd);
112if (isdef('editor') | (funptr('editor')<>0)) then 115editor(TMPDIR+'/text.txt')
113 editor(TMPDIR+'/text.txt') 116
114end
115mfprintf(0,'stderr output.\n'); 117mfprintf(0,'stderr output.\n');
116mfprintf(6,'stdout output.\n'); 118mfprintf(6,'stdout output.\n');
117 ]]></programlisting> 119 ]]></programlisting>
120 <para/>
121 <programlisting role="example"><![CDATA[
122I = (1:4)';
123A = [26.93 ; 63.25 ; 40.51 ; 91.84];
124B = [ 3.62 ; 15.04 ; 25.3 ; 48.19];
125C = [ 4.37 28.06
126 48.18 %inf
127 41.48 %nan
128 26.39 77.83];
129Status = ["NOK" "NOK" "NOK" "OK"]';
130Format = "Iteration %d: Results: A= %f B= %2d%% Status= %3s C(1)= %g C(2)= %e\n";
131File = TMPDIR + "/mfprintf.txt";
132fd = mopen(File, 'wt');
133mfprintf(fd, Format, I, A, B, Status, C);
134mclose
135editor(File)
136 ]]></programlisting>
137 <screen><![CDATA[
138Iteration 1: Results: A= 26.930000 B= 3% Status= NOK C(1)= 4.37 C(2)= 2.806000e+01
139Iteration 2: Results: A= 63.250000 B= 15% Status= NOK C(1)= 48.18 C(2)= Inf
140Iteration 3: Results: A= 40.510000 B= 25% Status= NOK C(1)= 41.48 C(2)= Nan
141Iteration 4: Results: A= 91.840000 B= 48% Status= OK C(1)= 26.39 C(2)= 7.783000e+01
142]]></screen>
143 <para/>
144 <para>
145 Supernumerary columns or rows are ignored:
146 </para>
147 <programlisting role="example"><![CDATA[
148A = [%T %F %T %T %F]';
149B = [ 4.37 28.06
150 48.18 %inf
151 41.48 %nan ];
152File = TMPDIR + "/mfprintf.txt";
153fd = mopen(File, 'wt');
154mfprintf(fd, "OK? %s Value: %4.1f\n", A, B)
155mclose
156editor(File)
157 ]]></programlisting>
158 <screen><![CDATA[
159OK? T Value: 4.4
160OK? F Value: 48.2
161OK? T Value: 41.5
162]]></screen>
118 </refsection> 163 </refsection>
119 <refsection role="see also"> 164 <refsection role="see also">
120 <title>Смотрите также</title> 165 <title>Смотрите также</title>
121 <simplelist type="inline"> 166 <simplelist type="inline">
122 <member> 167 <member>
123 <link linkend="mclose">mclose</link> 168 <link linkend="printf_conversion">printf_conversion</link>
124 </member> 169 </member>
125 <member> 170 <member>
126 <link linkend="meof">meof</link> 171 <link linkend="csvWrite">csvWrite</link>
127 </member> 172 </member>
128 <member> 173 <member>
129 <link linkend="fprintfMat">fprintfMat</link> 174 <link linkend="fprintfMat">fprintfMat</link>
130 </member> 175 </member>
131 <member> 176 <member>
132 <link linkend="mfscanf">mfscanf</link> 177 <link linkend="write">write</link>
133 </member> 178 </member>
134 <member> 179 <member>
135 <link linkend="fscanfMat">fscanfMat</link> 180 <link linkend="mputl">mputl</link>
136 </member>
137 <member>
138 <link linkend="mget">mget</link>
139 </member>
140 <member>
141 <link linkend="mgetstr">mgetstr</link>
142 </member>
143 <member>
144 <link linkend="mopen">mopen</link>
145 </member>
146 <member>
147 <link linkend="mprintf">mprintf</link>
148 </member>
149 <member>
150 <link linkend="mput">mput</link>
151 </member> 181 </member>
152 <member> 182 <member>
153 <link linkend="mputstr">mputstr</link> 183 <link linkend="mputstr">mputstr</link>
154 </member> 184 </member>
155 <member> 185 <member>
156 <link linkend="mseek">mseek</link> 186 <link linkend="mopen">mopen</link>
157 </member> 187 </member>
158 <member> 188 <member>
159 <link linkend="mtell">mtell</link> 189 <link linkend="mclose">mclose</link>
160 </member> 190 </member>
161 <member> 191 <member>
162 <link linkend="mdelete">mdelete</link> 192 <link linkend="mprintf">msprintf</link>
163 </member> 193 </member>
164 <member> 194 <member>
165 <link linkend="printf_conversion">преобразование в printf</link> 195 <link linkend="mfscanf">mfscanf</link>
166 </member> 196 </member>
167 </simplelist> 197 </simplelist>
168 </refsection> 198 </refsection>
199 <refsection role="history">
200 <title>История</title>
201 <revhistory>
202 <revision>
203 <revnumber>6.1.1</revnumber>
204 <revdescription>
205 Input data can be boolean.
206 </revdescription>
207 </revision>
208 </revhistory>
209 </refsection>
169</refentry> 210</refentry>
170
diff --git a/scilab/modules/localization/help/en_US/gettext.xml b/scilab/modules/localization/help/en_US/gettext.xml
index 1c005f7..77e6a81 100644
--- a/scilab/modules/localization/help/en_US/gettext.xml
+++ b/scilab/modules/localization/help/en_US/gettext.xml
@@ -4,7 +4,7 @@
4 * Copyright (C) 2007 - INRIA - Allan CORNET 4 * Copyright (C) 2007 - INRIA - Allan CORNET
5 * Copyright (C) 2007 - INRIA - Sylvestre LEDRU 5 * Copyright (C) 2007 - INRIA - Sylvestre LEDRU
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * Copyright (C) 2018 - Samuel GOUGEON 7 * Copyright (C) 2018 - 2021 - Samuel GOUGEON
8 * 8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0, 9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1. 10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -46,9 +46,10 @@
46 <term>"The literal reference message"</term> 46 <term>"The literal reference message"</term>
47 <listitem> 47 <listitem>
48 <para> 48 <para>
49 Single literal text of an english message to be indexed or/and 49 Single case-sensitive literal text of an english message to be indexed or/and
50 translated. A column of literal texts explicitly separated with 50 translated. A column of literal texts explicitly separated with
51 semi-colons may also be specified. 51 semi-colons may also be specified. Messages can include some
52 <link linkend="printf_conversion">C-like placeholders</link> starting with "%".
52 </para> 53 </para>
53 <warning> 54 <warning>
54 Only standard ASCII characters can be used. Any other extended ASCII or 55 Only standard ASCII characters can be used. Any other extended ASCII or
@@ -61,8 +62,8 @@
61 <term>msgid</term> 62 <term>msgid</term>
62 <listitem> 63 <listitem>
63 <para> 64 <para>
64 single or array of messages identifiers (in english) to be translated, 65 single or array of case-sensitive messages identifiers (in english) to be
65 in a variable. 66 translated, in a variable.
66 </para> 67 </para>
67 <warning> 68 <warning>
68 Only standard ASCII characters can be used. 69 Only standard ASCII characters can be used.
@@ -80,8 +81,8 @@
80 the same sizes. 81 the same sizes.
81 </para> 82 </para>
82 <note> 83 <note>
83 These messages are defined in the ./locales/*.po files. They can include 84 These messages are labelled <literal>msgstr</literal> and defined in
84 extended ASCII or UTF-8 characters. 85 the ./locales/*.po files. They can include extended ASCII or UTF-8 characters.
85 </note> 86 </note>
86 <para/> 87 <para/>
87 </listitem> 88 </listitem>
@@ -337,17 +338,12 @@ gettext(["item#1" ;
337 </refsect3> 338 </refsect3>
338 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> 339 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
339 <refsect3> 340 <refsect3>
340 <title>Messages</title> 341 <title>msgid messages</title>
341 <para> 342 <para>
342 To be correctly processed, english messages must comply with a few rules: 343 To be correctly processed, english messages must comply with a few rules:
343 <itemizedlist> 344 <itemizedlist>
344 <listitem> 345 <listitem>
345 <para> 346 <para>
346 Messages identifiers are case-sensitive.
347 </para>
348 </listitem>
349 <listitem>
350 <para>
351 Literal harvestable messages may be indifferently delimited with single 347 Literal harvestable messages may be indifferently delimited with single
352 or double quotes. 348 or double quotes.
353 </para> 349 </para>
@@ -383,26 +379,71 @@ gettext(["item#1" ;
383 </listitem> 379 </listitem>
384 <listitem> 380 <listitem>
385 <para> 381 <para>
386 Some template messages may often include some "%" C-like directives 382 msgid messages often include some "%" C-like placeholders
387 aiming to be replaced with some custom input data through 383 aiming to be replaced with some custom input data through
388 <literal>msprintf()</literal> at run time. 384 <literal>msprintf()</literal> at run time.
389 For instance, 385 For instance,
390 <literal>msprintf("Hi %s, could you come at %s today?", "John", "12:30")</literal> 386 <literal>msprintf("Hi %s, could you come at %s today?", "John", "12:30")</literal>
391 will return <literal>"Hi John, could you come at 12:30 today?"</literal>. 387 will return <literal>"Hi John, could you come at 12:30 today?"</literal>.
392 </para> 388 </para>
393 <warning> 389 </listitem>
390 </itemizedlist>
391 </para>
392 </refsect3>
393 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
394 <refsect3>
395 <title>msgstr translated messages</title>
396 <para>
397 This section will be more useful for translaters than for actual users.
398 </para>
399 <para>
400 When an english msgid message includes some C-like placeholders,
401 this always means that in the code the <varname>translated</varname> message
402 is processed with msprintf() to replace placeholders with actual values.
403 Hence, <emphasis>the order and type of placeholders indicate the order and
404 types of actual input values when calling msprintf</emphasis>.
405 </para>
406 <para>
407 This is of first importance for translaters, when writing the corresponding
408 <varname>translated</varname> message:
409 <itemizedlist>
410 <listitem>
411 If placeholders are not numbered: they must be in the same order and
412 types in the <varname>translated</varname> <literal>msgstr</literal>
413 message than in the <varname>msgid</varname> message. Example (english to french):
414 <screen>
415msgid "%s is %d year old.\n"
416msgstr "%s a %d ans.\n"
417// first %s (a string), second %d (a decimal number), in both strings.
418
419Then, from a Scilab session set to french, we will get
420gettext("%s is %d year old.\n") // => "%s a %d ans.\n"
421// and first v v second
422t = msprintf(gettext("%s is %d year old.\n"), "Peter", 18)
423// => "Peter a 18 ans."
424</screen>
425 </listitem>
426 <listitem>
394 <para> 427 <para>
395 Now, let's assume that you wish to make the template message translatable: 428 Otherwise,
396 <literal>msg = _("Hi %s, could you come at %s today?")</literal> 429 <emphasis>All</emphasis> placeholders must be numbered in the
397 and <literal>msprintf(msg, "John", "12:30")</literal> 430 <varname>translated</varname> message. Each numbered placeholder can
398 will be used. However, the author or/and translaters must be aware that, 431 be used only once in the format (Scilab limitation).
399 in the translated versions, the input data must appear in the same order: 432 Example (english to japanese):
400 "%s" for "John" before "%s" for "12:30", to comply with the order 433 <screen>
401 imposed by the <literal>msprintf()</literal> input list of values. 434msgid "%s: Wrong number of input argument: %d to %d expected.\n"
402 This is not always possible, noticeably for languages far from 435msgstr "%1$s: 入力引数で不正な数: %3$d への %2$d を想定します。\n"
403 latin like right-to-left languages. 436
437Then,
438msprintf(gettext("%s: Wrong number of input argument: %d to %d expected.\n"), "myFun", 2, 5)
439
440will return in a Scilab session set to english
441"myFun: Wrong number of input argument: 2 to 5 expected."
442
443while, in a Scilab session set to japanese
444"myFun: 入力引数で不正な数: 5 への 2 を想定します。"
445</screen>
404 </para> 446 </para>
405 </warning>
406 </listitem> 447 </listitem>
407 </itemizedlist> 448 </itemizedlist>
408 </para> 449 </para>
@@ -491,6 +532,43 @@ msg = "%s: No more memory.\n";
491!%s : Plus de mémoire disponible.\n ! 532!%s : Plus de mémoire disponible.\n !
492!%s : Overwrite Scilab translation.\n ! 533!%s : Overwrite Scilab translation.\n !
493]]></screen> 534]]></screen>
535 <para/>
536 <para>
537 Messages with numbered C-like placeholders:
538 </para>
539 <programlisting role="example"><![CDATA[
540in = getlanguage();
541msg = "%s: Unknown value %s for %s option"; // has already some translations
542setlanguage("en");
543t = gettext(msg)
544msprintf(t, "setdiff", "''f''", "''direction''")
545
546setlanguage("ja");
547t = gettext(msg)
548msprintf(t, "setdiff", "''f''", "''direction''")
549
550setlanguage(in);
551 ]]></programlisting>
552 <screen><![CDATA[
553--> setlanguage("en");
554--> t = gettext(msg)
555 t =
556 "%s: Unknown value %s for %s option"
557
558--> msprintf(t, "setdiff", "''f''", "''direction''")
559 ans =
560 "setdiff: Unknown value 'f' for 'direction' option"
561
562
563--> setlanguage("ja");
564--> t = gettext(msg)
565 t =
566 "%1$s: %3$s オプション の未知の値 %2$s"
567
568--> msprintf(t, "setdiff", "''f''", "''direction''")
569 ans =
570 "setdiff: 'direction' オプション の未知の値 'f'"
571]]></screen>
494 </refsection> 572 </refsection>
495 <refsection role="see also"> 573 <refsection role="see also">
496 <title>See also</title> 574 <title>See also</title>
@@ -525,6 +603,12 @@ msg = "%s: No more memory.\n";
525 <revnumber>5.5.0</revnumber> 603 <revnumber>5.5.0</revnumber>
526 <revdescription>Domain management added.</revdescription> 604 <revdescription>Domain management added.</revdescription>
527 </revision> 605 </revision>
606 <revision>
607 <revnumber>6.1.0</revnumber>
608 <revdescription>
609 C-like placeholders in messages can now be numbered.
610 </revdescription>
611 </revision>
528 </revhistory> 612 </revhistory>
529 </refsection> 613 </refsection>
530</refentry> 614</refentry>
diff --git a/scilab/modules/localization/help/ru_RU/gettext.xml b/scilab/modules/localization/help/ru_RU/gettext.xml
index 2b6cc8c..d226d72 100644
--- a/scilab/modules/localization/help/ru_RU/gettext.xml
+++ b/scilab/modules/localization/help/ru_RU/gettext.xml
@@ -4,7 +4,7 @@
4 * Copyright (C) 2007 - INRIA - Allan CORNET 4 * Copyright (C) 2007 - INRIA - Allan CORNET
5 * Copyright (C) 2007 - INRIA - Sylvestre LEDRU 5 * Copyright (C) 2007 - INRIA - Sylvestre LEDRU
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * Copyright (C) 2018 - Samuel GOUGEON 7 * Copyright (C) 2018 - 2021 - Samuel GOUGEON
8 * 8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0, 9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1. 10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -46,9 +46,11 @@
46 <term>"The literal reference message"</term> 46 <term>"The literal reference message"</term>
47 <listitem> 47 <listitem>
48 <para> 48 <para>
49 Единый символьный текст сообщения на английском языке, которое 49 Единый с учетом регистра символьный текст сообщения на английском языке, которое
50 требуется индексировать или/и перевести. Может быть также 50 требуется индексировать или/и перевести. Может быть также
51 указан столбец символьных текстов явно разделённых точкой с запятой. 51 указан столбец символьных текстов явно разделённых точкой с запятой.
52 Messages can include some
53 <link linkend="printf_conversion">C-like placeholders</link> starting with "%".
52 </para> 54 </para>
53 <warning> 55 <warning>
54 Могут использоваться только стандартные символы ASCII. 56 Могут использоваться только стандартные символы ASCII.
@@ -62,8 +64,8 @@
62 <term>msgid</term> 64 <term>msgid</term>
63 <listitem> 65 <listitem>
64 <para> 66 <para>
65 один или массив идентификаторов сообщений (на английском) для 67 один или массив идентификаторов сообщений с учетом регистра (на английском)
66 перевода, в переменной. 68 ля еревода, в переменной.
67 </para> 69 </para>
68 <warning> 70 <warning>
69 Могут использоваться только стандартные символы ASCII. 71 Могут использоваться только стандартные символы ASCII.
@@ -339,7 +341,7 @@ gettext(["item#1" ;
339 </refsect3> 341 </refsect3>
340 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> 342 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
341 <refsect3> 343 <refsect3>
342 <title>общения</title> 344 <title>msgid сообщения</title>
343 <para> 345 <para>
344 Для корректной обработки сообщения на английском должны соответствовать 346 Для корректной обработки сообщения на английском должны соответствовать
345 нескольким правилам: 347 нескольким правилам:
@@ -394,20 +396,63 @@ gettext(["item#1" ;
394 <literal>msprintf("Hi %s, could you come at %s today?", "John", "12:30")</literal> 396 <literal>msprintf("Hi %s, could you come at %s today?", "John", "12:30")</literal>
395 вернёт <literal>"Hi John, could you come at 12:30 today?"</literal>. 397 вернёт <literal>"Hi John, could you come at 12:30 today?"</literal>.
396 </para> 398 </para>
397 <warning> 399 </listitem>
400 </itemizedlist>
401 </para>
402 </refsect3>
403 <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
404 <refsect3>
405 <title>msgstr translated messages</title>
406 <para>
407 This section will be more useful for translaters than for actual users.
408 </para>
409 <para>
410 When an english msgid message includes some C-like placeholders,
411 this always means that in the code the <varname>translated</varname> message
412 is processed with msprintf() to replace placeholders with actual values.
413 Hence, <emphasis>the order and type of placeholders indicate the order and
414 types of actual input values when calling msprintf</emphasis>.
415 </para>
416 <para>
417 This is of first importance for translaters, when writing the corresponding
418 <varname>translated</varname> message:
419 <itemizedlist>
420 <listitem>
421 If placeholders are not numbered: they must be in the same order and
422 types in the <varname>translated</varname> <literal>msgstr</literal>
423 message than in the <varname>msgid</varname> message. Example (english to french):
424 <screen>
425msgid "%s is %d year old.\n"
426msgstr "%s a %d ans.\n"
427// first %s (a string), second %d (a decimal number), in both strings.
428
429Then, from a Scilab session set to french, we will get
430gettext("%s is %d year old.\n") // => "%s a %d ans.\n"
431// and first v v second
432t = msprintf(gettext("%s is %d year old.\n"), "Peter", 18)
433// => "Peter a 18 ans."
434</screen>
435 </listitem>
436 <listitem>
398 <para> 437 <para>
399 Теперь, предположим, что вы хотите сделать шаблонное сообщение для 438 Otherwise, <emphasis>All</emphasis> placeholders must be numbered in the
400 перевода: 439 <varname>translated</varname> message. Each numbered placeholder can
401 <literal>msg = _("Hi %s, could you come at %s today?")</literal> 440 be used only once in the format (Scilab limitation).
402 и будет использоваться <literal>msprintf(msg, "John", "12:30")</literal>. 441 Example (english to japanese):
403 Однако, автор и/или переводчики должны знать об этом, в переведённых 442 <screen>
404 версиях, входные данные должны появляться в том же порядке: 443msgid "%s: Wrong number of input argument: %d to %d expected.\n"
405 "%s" для "John" перед "%s" для "12:30", чтобы составить в 444msgstr "%1$s: 入力引数で不正な数: %3$d への %2$d を想定します。\n"
406 порядке, указанном списком входных значений <literal>msprintf()</literal>. 445
407 Это не всегда возможно, особенно для языков, отличных латыни, 446Then,
408 например, для языков, пишущих справа налево. 447msprintf(gettext("%s: Wrong number of input argument: %d to %d expected.\n"), "myFun", 2, 5)
448
449will return in a Scilab session set to english
450"myFun: Wrong number of input argument: 2 to 5 expected."
451
452while, in a Scilab session set to japanese
453"myFun: 入力引数で不正な数: 5 への 2 を想定します。"
454</screen>
409 </para> 455 </para>
410 </warning>
411 </listitem> 456 </listitem>
412 </itemizedlist> 457 </itemizedlist>
413 </para> 458 </para>
@@ -497,6 +542,43 @@ msg = "%s: No more memory.\n";
497!%s : Plus de mémoire disponible.\n ! 542!%s : Plus de mémoire disponible.\n !
498!%s : Overwrite Scilab translation.\n ! 543!%s : Overwrite Scilab translation.\n !
499]]></screen> 544]]></screen>
545 <para/>
546 <para>
547 Messages with numbered C-like placeholders:
548 </para>
549 <programlisting role="example"><![CDATA[
550in = getlanguage();
551msg = "%s: Unknown value %s for %s option"; // has already some translations
552setlanguage("en");
553t = gettext(msg)
554msprintf(t, "setdiff", "''f''", "''direction''")
555
556setlanguage("ja");
557t = gettext(msg)
558msprintf(t, "setdiff", "''f''", "''direction''")
559
560setlanguage(in);
561 ]]></programlisting>
562 <screen><![CDATA[
563--> setlanguage("en");
564--> t = gettext(msg)
565 t =
566 "%s: Unknown value %s for %s option"
567
568--> msprintf(t, "setdiff", "''f''", "''direction''")
569 ans =
570 "setdiff: Unknown value 'f' for 'direction' option"
571
572
573--> setlanguage("ja");
574--> t = gettext(msg)
575 t =
576 "%1$s: %3$s オプション の未知の値 %2$s"
577
578--> msprintf(t, "setdiff", "''f''", "''direction''")
579 ans =
580 "setdiff: 'direction' オプション の未知の値 'f'"
581]]></screen>
500 </refsection> 582 </refsection>
501 <refsection role="see also"> 583 <refsection role="see also">
502 <title>Смотрите также</title> 584 <title>Смотрите также</title>
@@ -531,6 +613,12 @@ msg = "%s: No more memory.\n";
531 <revnumber>5.5.0</revnumber> 613 <revnumber>5.5.0</revnumber>
532 <revdescription>Добавлено управление доменом.</revdescription> 614 <revdescription>Добавлено управление доменом.</revdescription>
533 </revision> 615 </revision>
616 <revision>
617 <revnumber>6.1.0</revnumber>
618 <revdescription>
619 C-like placeholders in messages can now be numbered.
620 </revdescription>
621 </revision>
534 </revhistory> 622 </revhistory>
535 </refsection> 623 </refsection>
536</refentry> 624</refentry>
diff --git a/scilab/modules/output_stream/help/en_US/mprintf.xml b/scilab/modules/output_stream/help/en_US/mprintf.xml
index 716bfff..f3ee5b2 100644
--- a/scilab/modules/output_stream/help/en_US/mprintf.xml
+++ b/scilab/modules/output_stream/help/en_US/mprintf.xml
@@ -3,8 +3,8 @@
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA 4 * Copyright (C) 2008 - INRIA
5 * ... 5 * ...
6 *
7 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * Copyright (C) 2021 - Samuel GOUGEON
8 * 8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0, 9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1. 10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -38,19 +38,21 @@
38 <varlistentry> 38 <varlistentry>
39 <term>format</term> 39 <term>format</term>
40 <listitem> 40 <listitem>
41 <para>a Scilab string describing the format to use to write the 41 <para>a string providing the format to use to write all next arguments.
42 remaining operands. The format operand follows, as close as 42 The <varname>format</varname> follows -- as close as possible -- the C printf
43 possible, the C printf format operand syntax, as described 43 format operand syntax, as described in the
44 in the <link linkend="printf_conversion">printf_conversion</link> 44 <link linkend="printf_conversion">printf_conversion</link> page.
45 page. 45 UTF-8 extended characters and numbered placeholders "%n$.." are supported.
46 </para> 46 </para>
47 </listitem> 47 </listitem>
48 </varlistentry> 48 </varlistentry>
49 <varlistentry> 49 <varlistentry>
50 <term>a1,...,an</term> 50 <term>a1,...,an</term>
51 <listitem> 51 <listitem>
52 <para>Specifies the data to be converted and printed according to 52 <para>
53 the format parameter. 53 Data to be converted and printed according to the <varname>format</varname>
54 argument. Supported types: all numbers, booleans, strings. Only the real part
55 of complex numbers is considered (current Scilab limitation).
54 </para> 56 </para>
55 </listitem> 57 </listitem>
56 </varlistentry> 58 </varlistentry>
@@ -59,32 +61,117 @@
59 <refsection> 61 <refsection>
60 <title>Description</title> 62 <title>Description</title>
61 <para> 63 <para>
62 The <literal>mprintf</literal> function is a interface for C-coded version of 64 <literal>mprintf(format, a1, a2, ..)</literal> replaces placeholders provided inside the
63 <literal>printf</literal> function. 65 <varname>format</varname> string with values of <varname>a1</varname>, <varname>a2</varname>, ..
66 converted according to each respective placeholder directive, and writes the result to
67 the Scilab console.
68 </para>
69 <para>
70 If <varname>a1</varname>, <varname>a2</varname>, .. are arrays with multiple rows,
71 they feed the format row by row: the format is used iteratively for every row of the
72 (horizontally "concatenated") arrays, until the bottom
73 of the least tall array is reached. Remaining rows of taller arrays (if any) are ignored.
74 See examples.
75 </para>
76 <para>
77 If the total number of columns of <varname>a1</varname>, <varname>a2</varname>, ..
78 is bigger than the number of placeholders in the <varname>format</varname>,
79 then extra columns are ignored. If it is smaller, an error is yielded.
64 </para> 80 </para>
65 <para> 81 <para>
66 The <literal>mprintf</literal> function writes formatted operands to 82 The <literal>mprintf</literal> function is an extended interface for C-coded
67 the standard Scilab output (i.e the Scilab window). The argument operands 83 <literal>printf</literal>.
68 are formatted under control of the format operand.
69 </para> 84 </para>
70 </refsection> 85 </refsection>
71 <refsection> 86 <refsection>
72 <title>Examples</title> 87 <title>Examples</title>
73 <programlisting role="example"><![CDATA[ 88 <programlisting role="example"><![CDATA[
74mprintf('At iteration %i, Result is:\nalpha=%f',33,0.535) 89I = (1:4)';
75mprintf('%e ', [1; 2; 3]) 90A = [26.93 ; 63.25 ; 40.51 ; 91.84];
76mprintf('%d %d\n', [1, 2; 3, 4]) 91B = [ 3.62 ; 15.04 ; 25.3 ; 48.19];
77 ]]></programlisting> 92C = [ 4.37 28.06
93 48.18 %inf
94 41.48 %nan
95 26.39 77.83];
96Status = ["NOK" "NOK" "NOK" "OK"]';
97Format = "Iteration %d: Results: A= %f B= %2d%% Status= %3s C(1)= %g C(2)= %e\n";
98mprintf(Format, I, A, B, Status, C);
99 ]]></programlisting>
100 <screen><![CDATA[
101--> mprintf(Format, I, A, B, Status, C);
102Iteration 1: Results: A= 26.930000 B= 3% Status= NOK C(1)= 4.37 C(2)= 2.806000e+01
103Iteration 2: Results: A= 63.250000 B= 15% Status= NOK C(1)= 48.18 C(2)= Inf
104Iteration 3: Results: A= 40.510000 B= 25% Status= NOK C(1)= 41.48 C(2)= Nan
105Iteration 4: Results: A= 91.840000 B= 48% Status= OK C(1)= 26.39 C(2)= 7.783000e+01
106]]></screen>
107 <para/>
108 <para>
109 Supernumerary columns or rows are ignored:
110 </para>
111 <programlisting role="example"><![CDATA[
112A = [%T %F %T %T %F]';
113B = [ 4.37 28.06
114 48.18 %inf
115 41.48 %nan ];
116mprintf("OK? %s Value: %4.1f\n", A, B);
117 ]]></programlisting>
118 <screen><![CDATA[
119--> mprintf("OK? %s Value: %4.1f\n", A, B);
120OK? T Value: 4.4
121OK? F Value: 48.2
122OK? T Value: 41.5
123]]></screen>
124 <para/>
125 <para>
126 Numbered placeholders "%n$.." allow reordering printed data with the format:
127 </para>
128 <programlisting role="example"><![CDATA[
129names = ["Peter", "Martha" "John"]';
130ages = [32 25 8]';
131mprintf("%2$6s is %1$d-year old.\n", ages, names);
132 ]]></programlisting>
133 <screen><![CDATA[
134--> mprintf("%2$6s is %1$d-year old.\n", ages, names);
135 Peter is 32-year old.
136Martha is 25-year old.
137 John is 8-year old.
138]]></screen>
78 </refsection> 139 </refsection>
79 <refsection role="see also"> 140 <refsection role="see also">
80 <title>See also</title> 141 <title>See also</title>
81 <simplelist type="inline"> 142 <simplelist type="inline">
82 <member> 143 <member>
144 <link linkend="printf_conversion">printf_conversion</link>
145 </member>
146 <member>
83 <link linkend="disp">disp</link> 147 <link linkend="disp">disp</link>
84 </member> 148 </member>
85 <member> 149 <member>
86 <link linkend="printf_conversion">printf_conversion</link> 150 <link linkend="write">write</link>
151 </member>
152 <member>
153 <link linkend="percentio">percentio</link>
154 </member>
155 <member>
156 <link linkend="percentchars">percentchars</link>
87 </member> 157 </member>
88 </simplelist> 158 </simplelist>
89 </refsection> 159 </refsection>
160 <refsection role="history">
161 <title>History</title>
162 <revhistory>
163 <revision>
164 <revnumber>6.1.0</revnumber>
165 <revdescription>
166 Numbered placeholders "%n$.." are supported in the format.
167 </revdescription>
168 </revision>
169 <revision>
170 <revnumber>6.1.1</revnumber>
171 <revdescription>
172 Input data can be boolean.
173 </revdescription>
174 </revision>
175 </revhistory>
176 </refsection>
90</refentry> 177</refentry>
diff --git a/scilab/modules/output_stream/help/en_US/msprintf.xml b/scilab/modules/output_stream/help/en_US/msprintf.xml
index 1633f14..6f03a58 100644
--- a/scilab/modules/output_stream/help/en_US/msprintf.xml
+++ b/scilab/modules/output_stream/help/en_US/msprintf.xml
@@ -3,8 +3,8 @@
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA 4 * Copyright (C) 2008 - INRIA
5 * ... 5 * ...
6 *
7 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * Copyright (C) 2021 - Samuel GOUGEON
8 * 8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0, 9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1. 10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -14,7 +14,10 @@
14 * along with this program. 14 * along with this program.
15 * 15 *
16 --> 16 -->
17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="msprintf" xml:lang="en"> 17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
19 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
20 xmlns:scilab="http://www.scilab.org" xml:id="msprintf" xml:lang="en">
18 <refnamediv> 21 <refnamediv>
19 <refname>msprintf</refname> 22 <refname>msprintf</refname>
20 <refpurpose>converts, formats, and writes data in a string</refpurpose> 23 <refpurpose>converts, formats, and writes data in a string</refpurpose>
@@ -25,7 +28,7 @@
25 </refnamediv> 28 </refnamediv>
26 <refsynopsisdiv> 29 <refsynopsisdiv>
27 <title>Syntax</title> 30 <title>Syntax</title>
28 <synopsis>str = msprintf(format,a1,...,an);</synopsis> 31 <synopsis>str = msprintf(format, a1,...,an)</synopsis>
29 </refsynopsisdiv> 32 </refsynopsisdiv>
30 <refsection> 33 <refsection>
31 <title>Arguments</title> 34 <title>Arguments</title>
@@ -33,23 +36,29 @@
33 <varlistentry> 36 <varlistentry>
34 <term>format</term> 37 <term>format</term>
35 <listitem> 38 <listitem>
36 <para>a Scilab string describing the format to use to write the 39 <para>
37 remaining operands. 40 a string providing the format to use to write all next arguments.
41 The <varname>format</varname> follows -- as close as possible -- the C printf
42 format operand syntax, as described in the
43 <link linkend="printf_conversion">printf_conversion</link> page.
44 UTF-8 extended characters and numbered placeholders "%n$.." are supported.
38 </para> 45 </para>
39 </listitem> 46 </listitem>
40 </varlistentry> 47 </varlistentry>
41 <varlistentry> 48 <varlistentry>
42 <term>str</term> 49 <term>a1,...,an</term>
43 <listitem> 50 <listitem>
44 <para>a character string.</para> 51 <para>
52 Data to be converted and written according to the <varname>format</varname>
53 argument. Supported types: all numbers, booleans, strings. Only the real part
54 of complex numbers is considered (current Scilab limitation).
55 </para>
45 </listitem> 56 </listitem>
46 </varlistentry> 57 </varlistentry>
47 <varlistentry> 58 <varlistentry>
48 <term>a1,...,an</term> 59 <term>str</term>
49 <listitem> 60 <listitem>
50 <para>Specifies the data to be converted and printed according to 61 <para>a string, or a column of strings.</para>
51 the format parameter.
52 </para>
53 </listitem> 62 </listitem>
54 </varlistentry> 63 </varlistentry>
55 </variablelist> 64 </variablelist>
@@ -57,14 +66,28 @@
57 <refsection> 66 <refsection>
58 <title>Description</title> 67 <title>Description</title>
59 <para> 68 <para>
60 The <literal>msprintf</literal> writes formatted operands in its 69 <literal>str=msprintf(format, a1, a2, ..)</literal> replaces placeholders provided
61 returned value (a Scilab string). The argument operands are formatted 70 inside the <varname>format</varname> string with values of <varname>a1</varname>,
62 under control of the format operand. 71 <varname>a2</varname>, .. converted according to each respective placeholder directive,
72 and set the result to the <varname>str</varname> string.
73 </para>
74 <para>
75 If <varname>a1</varname>, <varname>a2</varname>, .. are arrays with multiple rows,
76 they feed the format row by row: the format is used iteratively for every row of the
77 (horizontally "concatenated") arrays, until the bottom
78 of the least tall array is reached. Remaining rows of taller arrays (if any) are ignored.
79 See examples.
80 </para>
81 <para>
82 If the total number of columns of <varname>a1</varname>, <varname>a2</varname>, ..
83 is bigger than the number of placeholders in the <varname>format</varname>,
84 then extra columns are ignored. If it is smaller, an error is yielded.
63 </para> 85 </para>
64 <para> 86 <para>
65 <note> 87 <note>
66 Note that, in this case, the escape sequences (<literal>"\n"</literal>) (in format) 88 If either the <varname>format</varname> includes some Next_line "\n" sequence,
67 split string to a matrix of string (see example). 89 or if all arrays <varname>a1</varname>, <varname>a2</varname>.. have at least 2 rows,
90 the result <varname>str</varname> is a column of strings. See examples.
68 </note> 91 </note>
69 </para> 92 </para>
70 </refsection> 93 </refsection>
@@ -76,17 +99,92 @@ msprintf('%5.3f\n%5.3f',123,0.732)
76msprintf('--%s-\n-%d--',"hello",3) 99msprintf('--%s-\n-%d--',"hello",3)
77msprintf('%e ', [1;2;3]) 100msprintf('%e ', [1;2;3])
78msprintf('%d %d\n', [1, 2; 3, 4]) 101msprintf('%d %d\n', [1, 2; 3, 4])
79 ]]></programlisting> 102 ]]></programlisting>
103 <para/>
104 <programlisting role="example"><![CDATA[
105I = (1:4)';
106A = [26.93 ; 63.25 ; 40.51 ; 91.84];
107B = [ 3.62 ; 15.04 ; 25.3 ; 48.19];
108C = [ 4.37 28.06
109 48.18 %inf
110 41.48 %nan
111 26.39 77.83];
112Status = ["NOK" "NOK" "NOK" "OK"]';
113Format = "Iteration %d: Results: A= %f B= %2d%% Status= %3s C(1)= %g C(2)= %e\n";
114msprintf(Format, I, A, B, Status, C)
115 ]]></programlisting>
116 <screen><![CDATA[
117--> msprintf(Format, I, A, B, Status, C)
118 ans =
119 "Iteration 1: Results: A= 26.930000 B= 3% Status= NOK C(1)= 4.37 C(2)= 2.806000e+01"
120 "Iteration 2: Results: A= 63.250000 B= 15% Status= NOK C(1)= 48.18 C(2)= Inf"
121 "Iteration 3: Results: A= 40.510000 B= 25% Status= NOK C(1)= 41.48 C(2)= Nan"
122 "Iteration 4: Results: A= 91.840000 B= 48% Status= OK C(1)= 26.39 C(2)= 7.783000e+01"
123]]></screen>
124 <para/>
125 <para>
126 Supernumerary columns or rows are ignored:
127 </para>
128 <programlisting role="example"><![CDATA[
129A = [%T %F %T %T %F]';
130B = [ 4.37 28.06
131 48.18 %inf
132 41.48 %nan ];
133msprintf("OK? %s Value: %4.1f\n", A, B)
134 ]]></programlisting>
135 <screen><![CDATA[
136--> msprintf("OK? %s Value: %4.1f\n", A, B)
137 ans =
138 "OK? T Value: 4.4"
139 "OK? F Value: 48.2"
140 "OK? T Value: 41.5"
141]]></screen>
142 <para/>
143 <para>
144 Numbered placeholders "%n$.." allow reordering printed data with the format:
145 </para>
146 <programlisting role="example"><![CDATA[
147names = ["Peter", "Martha" "John"]';
148ages = [32 25 8]';
149msprintf("%2$6s is %1$d-year old.\n", ages, names)
150 ]]></programlisting>
151 <screen><![CDATA[
152--> msprintf("%2$6s is %1$d-year old.\n", ages, names)
153 ans =
154 " Peter is 32-year old."
155 "Martha is 25-year old."
156 " John is 8-year old."
157]]></screen>
80 </refsection> 158 </refsection>
81 <refsection role="see also"> 159 <refsection role="see also">
82 <title>See also</title> 160 <title>See also</title>
83 <simplelist type="inline"> 161 <simplelist type="inline">
84 <member> 162 <member>
163 <link linkend="printf_conversion">printf_conversion</link>
164 </member>
165 <member>
85 <link linkend="mprintf">mprintf</link> 166 <link linkend="mprintf">mprintf</link>
86 </member> 167 </member>
87 <member> 168 <member>
88 <link linkend="printf_conversion">printf_conversion</link> 169 <link linkend="percentchars">percentchars</link>
89 </member> 170 </member>
90 </simplelist> 171 </simplelist>
91 </refsection> 172 </refsection>
173 <refsection role="history">
174 <title>History</title>
175 <revhistory>
176 <revision>
177 <revnumber>6.1.0</revnumber>
178 <revdescription>
179 Numbered placeholders "%n$.." are supported in the format.
180 </revdescription>
181 </revision>
182 <revision>
183 <revnumber>6.1.1</revnumber>
184 <revdescription>
185 Input data can be boolean.
186 </revdescription>
187 </revision>
188 </revhistory>
189 </refsection>
92</refentry> 190</refentry>
diff --git a/scilab/modules/output_stream/help/en_US/printf_conversion.xml b/scilab/modules/output_stream/help/en_US/printf_conversion.xml
index f693e7f..b87ad2c 100644
--- a/scilab/modules/output_stream/help/en_US/printf_conversion.xml
+++ b/scilab/modules/output_stream/help/en_US/printf_conversion.xml
@@ -2,8 +2,8 @@
2<!-- 2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) XXXX-2008 - INRIA 4 * Copyright (C) XXXX-2008 - INRIA
5 *
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2021 - Samuel GOUGEON
7 * 7 *
8 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -13,11 +13,13 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="printf_conversion" xml:lang="en"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
18 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:scilab="http://www.scilab.org" xml:id="printf_conversion" xml:lang="en">
17 <refnamediv> 20 <refnamediv>
18 <refname>printf_conversion</refname> 21 <refname>printf_conversion</refname>
19 <refpurpose>mprintf, msprintf, mfprintf conversion 22 <refpurpose>mprintf, msprintf, mfprintf C-format specifications
20 specifications
21 </refpurpose> 23 </refpurpose>
22 </refnamediv> 24 </refnamediv>
23 <refsection> 25 <refsection>
@@ -25,7 +27,7 @@
25 <para> 27 <para>
26 Each conversion specification in the <literal>mprintf</literal> , 28 Each conversion specification in the <literal>mprintf</literal> ,
27 <literal>msprintf</literal> , <literal>mfprintf</literal> 29 <literal>msprintf</literal> , <literal>mfprintf</literal>
28 <literal>format</literal> parameter has the following syntax: 30 <literal>format</literal> string has the following syntax:
29 </para> 31 </para>
30 <itemizedlist> 32 <itemizedlist>
31 <listitem> 33 <listitem>
@@ -33,29 +35,43 @@
33 </listitem> 35 </listitem>
34 <listitem> 36 <listitem>
35 <para> 37 <para>
38 An optional integer n ≥ 1 followed by "$". n is the index of the input data
39 to substitute to the placeholder, in the msprintf, mprintf .. list of input data.
40 In a format string, placeholders are either all numbered or all non-numbered.
41 A given numbered placeholder can be used only once in its C-format string
42 (Scilab limitation).
43 </para>
44 </listitem>
45 <listitem>
46 <para>
36 Zero or more <literal>options</literal>, which modify the 47 Zero or more <literal>options</literal>, which modify the
37 meaning of the conversion specification. The following list contains 48 meaning of the conversion specification. The following list contains
38 the <literal>option</literal> characters and their meanings: 49 the <literal>option</literal> characters and their meanings:
39 </para> 50 </para>
40 <itemizedlist> 51 <table>
41 <listitem> 52 <tr>
42 <para>- : Left align, within the field, the result of the 53 <th>- :</th>
43 conversion. 54 <td>
44 </para> 55 Left align, within the field, the result of the conversion.
45 </listitem> 56 </td>
46 <listitem> 57 </tr>
47 <para>+ : Begin the result of a signed conversion with a sign (+ 58 <tr>
48 or -). 59 <th>+ :</th>
49 </para> 60 <td>
50 </listitem> 61 Begin the result of a signed conversion with a sign (+ or -).
51 <listitem> 62 </td>
52 <para>'space' : Prefix a space character to the result if the 63 </tr>
64 <tr>
65 <td style="white-space:nowrap"><emphasis role="bold">' ' :</emphasis></td>
66 <td>(space) Prefix a space character to the result if the
53 first character of a signed conversion is not a sign. If both the 67 first character of a signed conversion is not a sign. If both the
54 (space) and + options appear, the (space) option is ignored 68 (space) and + options appear, the (space) option is ignored.
55 </para> 69 </td>
56 </listitem> 70 </tr>
57 <listitem> 71 <tr>
58 <para># : Convert the value to an alternate form. For 72 <th># :</th>
73 <td>
74 Convert the value to an alternate form. For
59 <literal>c</literal>, <literal>d</literal>, <literal>i</literal>, 75 <literal>c</literal>, <literal>d</literal>, <literal>i</literal>,
60 <literal>s</literal>, and <literal>u</literal> conversions, the 76 <literal>s</literal>, and <literal>u</literal> conversions, the
61 <literal>#</literal> option has no effect. For 77 <literal>#</literal> option has no effect. For
@@ -68,10 +84,12 @@
68 no digits follow it. For <literal>g</literal> and 84 no digits follow it. For <literal>g</literal> and
69 <literal>G</literal> conversions, trailing zeros are not removed 85 <literal>G</literal> conversions, trailing zeros are not removed
70 from the result. 86 from the result.
71 </para> 87 </td>
72 </listitem> 88 </tr>
73 <listitem> 89 <tr>
74 <para>0 : Pad to the field width, using leading zeros (following 90 <th>0 :</th>
91 <td>
92 Pad to the field width, using leading zeros (following
75 any indication of sign or base) for <literal>d</literal>, 93 any indication of sign or base) for <literal>d</literal>,
76 <literal>i</literal>, <literal>o</literal>, <literal>u</literal>, 94 <literal>i</literal>, <literal>o</literal>, <literal>u</literal>,
77 <literal>x</literal>, <literal>X</literal>, <literal>e</literal>, 95 <literal>x</literal>, <literal>X</literal>, <literal>e</literal>,
@@ -83,12 +101,13 @@
83 <literal>o</literal> <literal>u</literal>, <literal>x</literal>, 101 <literal>o</literal> <literal>u</literal>, <literal>x</literal>,
84 and <literal>X</literal> conversions, if a precision is specified, 102 and <literal>X</literal> conversions, if a precision is specified,
85 the <literal>0</literal> flag is also ignored. 103 the <literal>0</literal> flag is also ignored.
86 </para> 104 </td>
87 </listitem> 105 </tr>
88 </itemizedlist> 106 </table>
89 </listitem> 107 </listitem>
90 <listitem> 108 <listitem>
91 <para>An optional decimal digit string that specifies the minimum field 109 <para>
110 An optional decimal digit string that specifies the minimum field
92 width. If the converted value has fewer characters than the field width, 111 width. If the converted value has fewer characters than the field width,
93 the field is padded on the left to the length specified by the field 112 the field is padded on the left to the length specified by the field
94 width. If the left-adjustment option is specified, the field is padded on 113 width. If the left-adjustment option is specified, the field is padded on
@@ -103,66 +122,99 @@
103 </para> 122 </para>
104 <itemizedlist> 123 <itemizedlist>
105 <listitem> 124 <listitem>
106 <para> 125 The minimum number of digits to appear for <literal>d</literal>,
107 The minimum number of digits to appear for <literal>d</literal>, 126 <literal>u</literal>, <literal>o</literal>, <literal>x</literal>, or
108 <literal>u</literal>, <literal>o</literal>, <literal>x</literal>, or 127 <literal>X</literal> conversions.
109 <literal>X</literal> conversions
110 </para>
111 </listitem> 128 </listitem>
112 <listitem> 129 <listitem>
113 <para>The number of digits to appear after the decimal point for 130 The number of digits to appear after the decimal point for
114 <literal>e</literal>, <literal>E</literal>, and <literal>f</literal> 131 <literal>e</literal>, <literal>E</literal>, and <literal>f</literal>
115 conversions 132 conversions.
116 </para>
117 </listitem> 133 </listitem>
118 <listitem> 134 <listitem>
119 <para>The maximum number of significant digits for 135 The maximum number of significant digits for
120 <literal>g</literal> and <literal>G</literal> conversions 136 <literal>g</literal> and <literal>G</literal> conversions.
121 </para>
122 </listitem> 137 </listitem>
123 <listitem> 138 <listitem>
124 <para>The maximum number of characters to be printed from a string in 139 The maximum number of characters to be printed from a string in
125 an <literal>s</literal> conversion 140 an <literal>s</literal> conversion.
126 </para>
127 </listitem> 141 </listitem>
128 </itemizedlist> 142 </itemizedlist>
129 </listitem> 143 </listitem>
130 <listitem> 144 <listitem>
131 <para>A character that indicates the type of conversion to be 145 <para>A character that indicates the type of conversion to be applied:
132 applied:
133 </para> 146 </para>
134 <itemizedlist> 147 <table>
135 <listitem> 148 <tr>
136 <para>% : Performs no conversion. Displays %.</para> 149 <th>% :</th>
137 </listitem> 150 <td>
138 <listitem> 151 Performs no conversion. Prints %.
139 <para> 152 <note>
140 d,i: Accepts an integer <literal>value</literal> and 153 This may be useful for instance to print percentages, or
141 converts it to signed decimal notation. The precision specifies 154 to process some LaTeX expression including LaTeX comments
155 starting with "%", etc.
156 </note>
157 </td>
158 </tr>
159 <tr>
160 <th>s :</th>
161 <td>
162 Accepts a string or boolean <literal>value</literal> and displays
163 characters from the string to the end or the number of characters
164 indicated by the precision is reached. If no precision is
165 specified, all characters up to the end are displayed.
166 UTF-8 extended characters are supported in input strings.
167 Booleans are converted into 'T' or 'F'.
168 </td>
169 </tr>
170 <tr>
171 <th>c :</th>
172 <td>
173 Not supported.
174 </td>
175 </tr>
176 <tr>
177 <td colspan="2">
178 All following conversions accept any decimal numerical or boolean
179 input <literal>value</literal>. Only the real part of any input
180 complex number is considered. Booleans are implicitly converted
181 into 0 and 1.
182 </td>
183 </tr>
184 <tr>
185 <th>d,i :</th>
186 <td>
187 Converts the input <literal>value</literal> to a signed integer int32
188 notation. Conversions for input |Numbers| ≥ 2^31 are not reliable.
189 The precision specifies
142 the minimum number of digits to appear. If the value being 190 the minimum number of digits to appear. If the value being
143 converted can be represented in fewer digits, it is expanded with 191 converted can be represented in fewer digits, it is expanded with
144 leading zeros. The default precision is 1. The result of 192 leading zeros. The default precision is 1. The result of
145 converting a zero value with a precision of zero is a null string. 193 converting a zero value with a precision of zero is a null string.
146 Specifying a field width with a zero as a leading character causes 194 Specifying a field width with a zero as a leading character causes
147 the field width value to be padded with leading zeros. 195 the field width value to be padded with leading zeros.
148 </para> 196 </td>
149 </listitem> 197 </tr>
150 <listitem> 198 <tr>
151 <para> 199 <th>u :</th>
152 u : Accepts an integer <literal>value</literal> and converts 200 <td>
153 it to unsigned decimal notation. The precision specifies the 201 Converts the input <literal>value</literal> to an unsigned integer
202 uint32 notation. Conversions for input |Numbers| ≥ 2^32 are not reliable.
203 The precision specifies the
154 minimum number of digits to appear. If the value being converted 204 minimum number of digits to appear. If the value being converted
155 can be represented in fewer digits, it is expanded with leading 205 can be represented in fewer digits, it is expanded with leading
156 zeros. The default precision is 1. The result of converting a zero 206 zeros. The default precision is 1. The result of converting a zero
157 value with a precision of zero is a null string. Specifying a 207 value with a precision of zero is a null string. Specifying a
158 field width with a zero as the leading character causes the field 208 field width with a zero as the leading character causes the field
159 width value to be padded with leading zeros. 209 width value to be padded with leading zeros.
160 </para> 210 </td>
161 </listitem> 211 </tr>
162 <listitem> 212 <tr>
163 <para> 213 <th>o :</th>
164 o : Accepts an integer <literal>value</literal> and converts 214 <td>
165 it to unsigned octal notation. The precision specifies the minimum 215 Converts the input <literal>value</literal> to an unsigned octal notation.
216 Conversions for input |Numbers| ≥ 2^32 are not reliable.
217 The precision specifies the minimum
166 number of digits to appear. If the value being converted can be 218 number of digits to appear. If the value being converted can be
167 represented in fewer digits, it is expanded with leading zeros. 219 represented in fewer digits, it is expanded with leading zeros.
168 The default precision is 1. The result of converting a zero value 220 The default precision is 1. The result of converting a zero value
@@ -170,14 +222,15 @@
170 width with a zero as the leading character causes the field width 222 width with a zero as the leading character causes the field width
171 value to be padded with leading zeros. An octal value for field 223 value to be padded with leading zeros. An octal value for field
172 width is not implied. 224 width is not implied.
173 </para> 225 </td>
174 </listitem> 226 </tr>
175 <listitem> 227 <tr>
176 <para> 228 <th>x, X :</th>
177 x, X : Accepts an integer <literal>value</literal> and 229 <td>
178 converts it to unsigned hexadecimal notation. The letters 230 Converts the input <literal>value</literal> to an unsigned hexadecimal
179 ``abcdef'' are used for the <literal>x</literal> conversion; the 231 notation. Conversions for input |Numbers| ≥ 2^32 are not reliable.
180 letters ``ABCDEF'' are used for the <literal>X</literal> 232 The letters ``abcdef'' are used for the <literal>x</literal> conversion;
233 the letters ``ABCDEF'' are used for the <literal>X</literal>
181 conversion. The precision specifies the minimum number of digits 234 conversion. The precision specifies the minimum number of digits
182 to appear. If the value being converted can be represented in 235 to appear. If the value being converted can be represented in
183 fewer digits, it is expanded with leading zeros. The default 236 fewer digits, it is expanded with leading zeros. The default
@@ -185,89 +238,71 @@
185 precision of zero is a null string. Specifying a field width with 238 precision of zero is a null string. Specifying a field width with
186 a zero as the leading character causes the field width value to be 239 a zero as the leading character causes the field width value to be
187 padded with leading zeros. 240 padded with leading zeros.
188 </para> 241 </td>
189 </listitem> 242 </tr>
190 <listitem> 243 <tr>
191 <para> 244 <th>f :</th>
192 f : Accepts a float or double <literal>value</literal> and 245 <td>
193 converts it to decimal notation in the format 246 Converts the input <literal>value</literal> to a decimal notation in
194 %[\-]<literal>ddd.ddd</literal>. The number of digits after the 247 the format %[\-]<literal>ddd.ddd</literal>.
195 decimal point is equal to the precision specification. 248 The number of digits after the decimal point is equal to the precision
196 </para> 249 specification.
197 <itemizedlist> 250 <itemizedlist>
198 <listitem> 251 <listitem>
199 <para>If no precision is specified, six digits are 252 If no precision is specified, six digits are output.
200 output. 253 </listitem>
201 </para> 254 <listitem>
202 </listitem> 255 If the precision is zero, no decimal point appears and
203 <listitem>
204 <para>If the precision is zero, no decimal point appears and
205 the system outputs a number rounded to the integer nearest to 256 the system outputs a number rounded to the integer nearest to
206 <literal>value</literal>. 257 <literal>value</literal>.
207 </para> 258 </listitem>
208 </listitem> 259 <listitem>
209 <listitem> 260 If a decimal point is output, at least one digit is output before it.
210 <para>If a decimal point is output, at least one digit is 261 </listitem>
211 output before it. 262 </itemizedlist>
212 </para> 263 </td>
213 </listitem> 264 </tr>
214 </itemizedlist> 265 <tr>
215 </listitem> 266 <th>e, E :</th>
216 <listitem> 267 <td>
217 <para>e, E : Accepts a real and converts it to the exponential 268 Converts the input <literal>value</literal> to the exponential
218 form %[\-]<literal>d.ddde</literal>+/\-<literal>dd</literal>. 269 form %[\-]<literal>d.ddde</literal>+/\-<literal>dd</literal>.
219 There is one digit before the decimal point, and the number of 270 There is one digit before the decimal point, and the number of
220 digits after the decimal point is equal to the precision 271 digits after the decimal point is equal to the precision
221 specification. 272 specification.
222 </para> 273 <itemizedlist>
223 <itemizedlist> 274 <listitem>
224 <listitem> 275 If no precision is specified, six digits are output.
225 <para>If no precision is specified, six digits are 276 </listitem>
226 output. 277 <listitem>
227 </para> 278 If the precision is zero, no decimal point appears.
228 </listitem> 279 </listitem>
229 <listitem> 280 <listitem>
230 <para>If the precision is zero, , no decimal point
231 appears.
232 </para>
233 </listitem>
234 <listitem>
235 <para>
236 The <literal>E</literal> conversion character produces a 281 The <literal>E</literal> conversion character produces a
237 number with E instead of e before the exponent. The exponent 282 number with E instead of e before the exponent. The exponent
238 always contains at least two digits. If the value is zero, the 283 always contains at least two digits. If the value is zero, the
239 exponent is zero. 284 exponent is zero.
240 </para> 285 </listitem>
241 </listitem> 286 </itemizedlist>
242 </itemizedlist> 287 </td>
243 </listitem> 288 </tr>
244 <listitem> 289 <tr>
245 <para>g, G : Accepts a real and converts it in the style of the 290 <td style="white-space:nowrap"><emphasis role="bold">g, G :</emphasis></td>
291 <td>
292 Converts the input <literal>value</literal> in the style of the
246 <literal>e</literal>, <literal>E</literal>, or 293 <literal>e</literal>, <literal>E</literal>, or
247 <literal>f</literal> conversion characters, with the precision 294 <literal>f</literal> conversion characters, with the precision
248 specifying the number of significant digits. Trailing zeros are 295 specifying the number of significant digits.
249 removed from the result. A decimal point appears only if it is 296 Trailing zeros are removed from the result.
250 followed by a digit. The style used depends on the value 297 A decimal point appears only if it is followed by a digit.
298 The style used depends on the value
251 converted. Style <literal>e</literal> (<literal>E</literal>, if 299 converted. Style <literal>e</literal> (<literal>E</literal>, if
252 <literal>G</literal> is the flag used) results only if the 300 <literal>G</literal> is the flag used) results only if the
253 exponent resulting from the conversion is less than -4, or if it 301 exponent resulting from the conversion is less than -4, or if it
254 is greater or equal to the precision. 302 is greater or equal to the precision.
255 </para> 303 </td>
256 </listitem> 304 </tr>
257 <listitem> 305 </table>
258 <para>c : Accepts and displays an integer value converted to a
259 character.
260 </para>
261 </listitem>
262 <listitem>
263 <para>
264 s : Accepts a string <literal>value</literal> and displays
265 characters from the string to the end or the number of characters
266 indicated by the precision is reached. If no precision is
267 specified, all characters up to the end are displayed.
268 </para>
269 </listitem>
270 </itemizedlist>
271 </listitem> 306 </listitem>
272 </itemizedlist> 307 </itemizedlist>
273 <para>A field width or precision can be indicated by an 308 <para>A field width or precision can be indicated by an
@@ -284,21 +319,46 @@
284 <para>The representation of the plus sign depends on whether the 319 <para>The representation of the plus sign depends on whether the
285 <literal>+</literal> or (space) formatting option is specified. 320 <literal>+</literal> or (space) formatting option is specified.
286 </para> 321 </para>
287 <para>display of exponential form %e is platform dependent with a different number of digits in exponent.</para> 322 <para>
288 <informaltable border="1"> 323 The display of exponential form %e is platform dependent with a different
289 <tr> 324 number of digits in exponent.
290 <td>Platform</td> 325 <informaltable border="1">
291 <td>Example: msprintf("%e",1.23e4)</td> 326 <tr>
292 </tr> 327 <td>Platform</td>
293 <tr> 328 <td>Example: msprintf("%e",1.23e4)</td>
294 <td>Windows</td> 329 </tr>
295 <td>1.23000e+004</td> 330 <tr>
296 </tr> 331 <td>Windows</td>
297 <tr> 332 <td>1.23000e+004</td>
298 <td>Linux/Mac OS</td> 333 </tr>
299 <td>1.23000e+04</td> 334 <tr>
300 </tr> 335 <td>Linux/Mac OS</td>
301 </informaltable> 336 <td>1.23000e+04</td>
337 </tr>
338 </informaltable>
339 </para>
340 <para>
341 <emphasis role="bold">Special escaped sequences</emphasis> are supported in Scilab
342 C-format strings:
343 <table>
344 <tr>
345 <th>\n :</th>
346 <td>Go to Next line (line feed)</td>
347 </tr>
348 <tr>
349 <th>\r :</th>
350 <td>Return: go to the head of current line (for overprinting)</td>
351 </tr>
352 <tr>
353 <th>\t :</th>
354 <td>horizontal Tab</td>
355 </tr>
356 <tr>
357 <th>\\ :</th>
358 <td>print a backslash \</td>
359 </tr>
360 </table>
361 </para>
302 </refsection> 362 </refsection>
303 <refsection> 363 <refsection>
304 <title>Examples</title> 364 <title>Examples</title>
@@ -320,7 +380,45 @@ mprintf('a float (exponential form): %3.2e\n', %pi);
320mprintf('a float (exponential form): %3.2g\n', %pi); 380mprintf('a float (exponential form): %3.2g\n', %pi);
321mprintf('a character: %c\n', 'a'); 381mprintf('a character: %c\n', 'a');
322mprintf('a character: %c\n', 'aaa'); 382mprintf('a character: %c\n', 'aaa');
323 ]]></programlisting> 383 ]]></programlisting>
384 <para/>
385 <para>
386 With input booleans:
387 </para>
388 <programlisting role="example"><![CDATA[
389mprintf("\n%%d: %d, %%u: %u, %%o: %o, %%f: %f, %%e: %e, %%s: %s\n" + ..
390 "%%d: %d, %%u: %u, %%o: %o, %%f: %f, %%e: %e, %%s: %s\n", ..
391 %T, %T, %T, %T, %T, %T, %F, %F, %F, %F, %F, %F);
392 ]]></programlisting>
393 <screen><![CDATA[
394%d: 1, %u: 1, %o: 1, %f: 1.000000, %e: 1.000000e+00, %s: T
395%d: 0, %u: 0, %o: 0, %f: 0.000000, %e: 0.000000e+00, %s: F
396]]></screen>
397 <para/>
398 <para>
399 With numbered placeholders:
400 </para>
401 <programlisting role="example"><![CDATA[
402mprintf("%2$s is %1$d-year old.\n", 32, "Peter");
403 ]]></programlisting>
404 <screen><![CDATA[
405Peter is 32-year old.
406]]></screen>
407 <para/>
408 <para>
409 With escaped sequences and UTF-8 extended characters:
410 </para>
411 <programlisting role="example"><![CDATA[
412mprintf("The path T:\\abc does not exist.\n");
413mprintf("abcdefghijk\tαβδ\tεϵ\tζηθικλ\rABCDE\n");
414 ]]></programlisting>
415 <screen><![CDATA[
416--> mprintf("The path T:\\abc does not exist.\n");
417The path T:\abc does not exist
418
419--> mprintf("abcdefghijk\tαβδ\tεϵ\tζηθικλ\rABCDE\n");
420ABCDEfghijk αβδ εϵ ζηθικλ
421]]></screen>
324 </refsection> 422 </refsection>
325 <refsection role="see also"> 423 <refsection role="see also">
326 <title>See also</title> 424 <title>See also</title>
@@ -336,4 +434,21 @@ mprintf('a character: %c\n', 'aaa');
336 </member> 434 </member>
337 </simplelist> 435 </simplelist>
338 </refsection> 436 </refsection>
437 <refsection role="history">
438 <title>History</title>
439 <revhistory>
440 <revision>
441 <revnumber>6.1.0</revnumber>
442 <revdescription>
443 Numbered placeholders "%n$.." are supported.
444 </revdescription>
445 </revision>
446 <revision>
447 <revnumber>6.1.1</revnumber>
448 <revdescription>
449 Input boolean data can be converted.
450 </revdescription>
451 </revision>
452 </revhistory>
453 </refsection>
339</refentry> 454</refentry>
diff --git a/scilab/modules/output_stream/help/ja_JP/mprintf.xml b/scilab/modules/output_stream/help/ja_JP/mprintf.xml
index 6dd7113..874572d5 100644
--- a/scilab/modules/output_stream/help/ja_JP/mprintf.xml
+++ b/scilab/modules/output_stream/help/ja_JP/mprintf.xml
@@ -3,8 +3,8 @@
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA 4 * Copyright (C) 2008 - INRIA
5 * ... 5 * ...
6 *
7 * Copyright (C) 2012 - 2016 - Scilab Enterprises 6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * Copyright (C) 2021 - Samuel GOUGEON
8 * 8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0, 9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1. 10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -47,13 +47,18 @@
47 formatオペランドは,C言語のprintfのformatオペランドと 47 formatオペランドは,C言語のprintfのformatオペランドと
48 構文にできるだけ近くなるよう作成されています, as described in the 48 構文にできるだけ近くなるよう作成されています, as described in the
49 <link linkend="printf_conversion">printf_conversion</link> page. 49 <link linkend="printf_conversion">printf_conversion</link> page.
50 UTF-8 extended characters and numbered placeholders "%n$.." are supported.
50 </para> 51 </para>
51 </listitem> 52 </listitem>
52 </varlistentry> 53 </varlistentry>
53 <varlistentry> 54 <varlistentry>
54 <term>a1,...,an</term> 55 <term>a1,...,an</term>
55 <listitem> 56 <listitem>
56 <para>formatパラメータに基づき変換,出力されるデータを定義します.</para> 57 <para>
58 formatパラメータに基づき変換,出力されるデータを定義します.
59 Supported types: all numbers, booleans, strings. Only the real part
60 of complex numbers is considered (current Scilab limitation).
61 </para>
57 </listitem> 62 </listitem>
58 </varlistentry> 63 </varlistentry>
59 </variablelist> 64 </variablelist>
@@ -61,30 +66,117 @@
61 <refsection> 66 <refsection>
62 <title>説明</title> 67 <title>説明</title>
63 <para> 68 <para>
64 <literal>mprintf</literal>関数はC言語の<literal>printf</literal>へ 69 <literal>mprintf(format, a1, a2, ..)</literal> replaces placeholders provided inside the
65 のインターフェイスです. 70 <varname>format</varname> string with values of <varname>a1</varname>, <varname>a2</varname>, ..
71 converted according to each respective placeholder directive, and writes the result to
72 the Scilab console.
66 </para> 73 </para>
67 <para> 74 <para>
68 <literal>mprintf</literal>関数は整形されたオペランドを 75 If <varname>a1</varname>, <varname>a2</varname>, .. are arrays with multiple rows,
69 Scilab標準出力(すなわち,Scilabウインドウ)に書き込みます. 76 they are processed row by row: the format is used iteratively for every row of the
70 argumentオペランドはformatオペランドの制御の下で整形されます. 77 arrays (horizontally "concatenated"), until the bottom
78 of the least tall array is reached. Remaining rows of taller arrays (if any) are ignored.
79 See examples.
80 </para>
81 <para>
82 If the total number of columns of <varname>a1</varname>, <varname>a2</varname>, ..
83 is bigger than the number of placeholders in the <varname>format</varname>,
84 then extra columns are ignored.
85 </para>
86 <para>
87 The <literal>mprintf</literal> function is an extended interface for C-coded
88 <literal>printf</literal>.
71 </para> 89 </para>
72 </refsection> 90 </refsection>
73 <refsection> 91 <refsection>
74 <title>例</title> 92 <title>例</title>
75 <programlisting role="example"><![CDATA[ 93 <programlisting role="example"><![CDATA[
76mprintf('At iteration %i, Result is:\nalpha=%f',33,0.535) 94I = (1:4)';
77 ]]></programlisting> 95A = [26.93 ; 63.25 ; 40.51 ; 91.84];
96B = [ 3.62 ; 15.04 ; 25.3 ; 48.19];
97C = [ 4.37 28.06
98 48.18 %inf
99 41.48 %nan
100 26.39 77.83];
101Status = ["NOK" "NOK" "NOK" "OK"]';
102Format = "Iteration %d: Results: A= %f B= %2d%% Status= %3s C(1)= %g C(2)= %e\n";
103mprintf(Format, I, A, B, Status, C);
104 ]]></programlisting>
105 <screen><![CDATA[
106--> mprintf(Format, I, A, B, Status, C);
107Iteration 1: Results: A= 26.930000 B= 3% Status= NOK C(1)= 4.37 C(2)= 2.806000e+01
108Iteration 2: Results: A= 63.250000 B= 15% Status= NOK C(1)= 48.18 C(2)= Inf
109Iteration 3: Results: A= 40.510000 B= 25% Status= NOK C(1)= 41.48 C(2)= Nan
110Iteration 4: Results: A= 91.840000 B= 48% Status= OK C(1)= 26.39 C(2)= 7.783000e+01
111]]></screen>
112 <para/>
113 <para>
114 Supernumerary columns or rows are ignored:
115 </para>
116 <programlisting role="example"><![CDATA[
117A = [%T %F %T %T %F]';
118B = [ 4.37 28.06
119 48.18 %inf
120 41.48 %nan ];
121mprintf("OK? %s Value: %4.1f\n", A, B);
122 ]]></programlisting>
123 <screen><![CDATA[
124--> mprintf("OK? %s Value: %4.1f\n", A, B);
125OK? T Value: 4.4
126OK? F Value: 48.2
127OK? T Value: 41.5
128]]></screen>
129 <para/>
130 <para>
131 Numbered placeholders "%n$.." allow reordering printed data with the format:
132 </para>
133 <programlisting role="example"><![CDATA[
134names = ["Peter", "Martha" "John"]';
135ages = [32 25 8]';
136mprintf("%2$6s is %1$d-year old.\n", ages, names);
137 ]]></programlisting>
138 <screen><![CDATA[
139--> mprintf("%2$6s is %1$d-year old.\n", ages, names);
140 Peter is 32-year old.
141Martha is 25-year old.
142 John is 8-year old.
143]]></screen>
78 </refsection> 144 </refsection>
79 <refsection role="see also"> 145 <refsection role="see also">
80 <title>参照</title> 146 <title>参照</title>
81 <simplelist type="inline"> 147 <simplelist type="inline">
82 <member> 148 <member>
149 <link linkend="printf_conversion">printf_conversion</link>
150 </member>
151 <member>
83 <link linkend="disp">disp</link> 152 <link linkend="disp">disp</link>
84 </member> 153 </member>
85 <member> 154 <member>
86 <link linkend="printf_conversion">printf_conversion</link> 155 <link linkend="write">write</link>
156 </member>
157 <member>
158 <link linkend="percentio">percentio</link>
159 </member>
160 <member>
161 <link linkend="percentchars">percentchars</link>
87 </member> 162 </member>
88 </simplelist> 163 </simplelist>
89 </refsection> 164 </refsection>
165 <refsection role="history">
166 <title>履歴</title>
167 <revhistory>
168 <revision>
169 <revnumber>6.1.0</revnumber>
170 <revdescription>
171 Numbered placeholders "%n$.." are supported in the format.
172 </revdescription>
173 </revision>
174 <revision>
175 <revnumber>6.1.1</revnumber>
176 <revdescription>
177 Input data can be boolean.
178 </revdescription>
179 </revision>
180 </revhistory>
181 </refsection>
90</refentry> 182</refentry>
diff --git a/scilab/modules/output_stream/help/ja_JP/msprintf.xml b/scilab/modules/output_stream/help/ja_JP/msprintf.xml
deleted file mode 100644
index 252b653..0000000
--- a/scilab/modules/output_stream/help/ja_JP/msprintf.xml
+++ /dev/null
@@ -1,90 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA
5 * ...
6 *
7 * Copyright (C) 2012 - 2016 - Scilab Enterprises
8 *
9 * This file is hereby licensed under the terms of the GNU GPL v2.0,
10 * pursuant to article 5.3.4 of the CeCILL v.2.1.
11 * This file was originally licensed under the terms of the CeCILL v2.1,
12 * and continues to be available under such terms.
13 * For more information, see the COPYING file which you should have received
14 * along with this program.
15 *
16 -->
17<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="msprintf" xml:lang="ja">
18 <refnamediv>
19 <refname>msprintf</refname>
20 <refpurpose>データを変換,整形し,文字列に書き込む</refpurpose>
21 </refnamediv>
22 <refnamediv xml:id="sprintf">
23 <refname>sprintf</refname>
24 <refpurpose>データを変換,整形し,文字列に書き込む (廃止)</refpurpose>
25 </refnamediv>
26 <refsynopsisdiv>
27 <title>呼び出し手順</title>
28 <synopsis>str = msprintf(format,a1,...,an);</synopsis>
29 </refsynopsisdiv>
30 <refsection>
31 <title>パラメータ</title>
32 <variablelist>
33 <varlistentry>
34 <term>format</term>
35 <listitem>
36 <para>
37 残りのオペランドを書き込む際に使用される
38 フォーマット定義するSclab文字列.
39 </para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term>str</term>
44 <listitem>
45 <para>文字列.</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term>a1,...,an</term>
50 <listitem>
51 <para>S
52 formatパラメータに基づき変換,出力されるデータを定義します.
53 </para>
54 </listitem>
55 </varlistentry>
56 </variablelist>
57 </refsection>
58 <refsection>
59 <title>説明</title>
60 <para>
61 <literal>msprintf</literal>は,整形されたオペランドを
62 その戻り値(Scilab文字列)に書き込みます.
63 argumentオペランドはformatオペランドの制御の下で
64 整形されます.
65 </para>
66 <para>
67 この場合,エスケープシーケンス(<literal>"\n"</literal>) は
68 文字列を文字列の行列に分割することに注意してください (例を参照)
69 </para>
70 </refsection>
71 <refsection>
72 <title>例</title>
73 <programlisting role="example"><![CDATA[
74msprintf('%5.3f %5.3f',123,0.732)
75msprintf('%5.3f\n%5.3f',123,0.732)
76msprintf('--%s-\n-%d--',"hello",3)
77 ]]></programlisting>
78 </refsection>
79 <refsection role="see also">
80 <title>参照</title>
81 <simplelist type="inline">
82 <member>
83 <link linkend="mprintf">mprintf</link>
84 </member>
85 <member>
86 <link linkend="printf_conversion">printf_conversion</link>
87 </member>
88 </simplelist>
89 </refsection>
90</refentry>
diff --git a/scilab/modules/output_stream/help/ja_JP/printf_conversion.xml b/scilab/modules/output_stream/help/ja_JP/printf_conversion.xml
index f98ca0e..1d6bd317 100644
--- a/scilab/modules/output_stream/help/ja_JP/printf_conversion.xml
+++ b/scilab/modules/output_stream/help/ja_JP/printf_conversion.xml
@@ -2,8 +2,8 @@
2<!-- 2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) XXXX-2008 - INRIA 4 * Copyright (C) XXXX-2008 - INRIA
5 *
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2021 - Samuel GOUGEON
7 * 7 *
8 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -13,7 +13,10 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="printf_conversion" xml:lang="ja"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
18 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:scilab="http://www.scilab.org" xml:id="printf_conversion" xml:lang="ja">
17 <refnamediv> 20 <refnamediv>
18 <refname>printf_conversion</refname> 21 <refname>printf_conversion</refname>
19 <refpurpose>mprintf, msprintf, mfprintf 変換仕様</refpurpose> 22 <refpurpose>mprintf, msprintf, mfprintf 変換仕様</refpurpose>
@@ -31,27 +34,45 @@
31 </listitem> 34 </listitem>
32 <listitem> 35 <listitem>
33 <para> 36 <para>
37 An optional integer n ≥ 1 followed by "$". n is the index of the input data
38 to substitute to the placeholder, in the msprintf, mprintf .. list of input data.
39 In a format string, placeholders are either all numbered or all non-numbered.
40 A given numbered placeholder can be used only once in its C-format string
41 (Scilab limitation).
42 </para>
43 </listitem>
44 <listitem>
45 <para>
34 0個以上の <literal>options</literal>で, 46 0個以上の <literal>options</literal>で,
35 変換仕様の意味を修正します. 47 変換仕様の意味を修正します.
36 以下のリストに<literal>option</literal>文字とその意味を示します: 48 以下のリストに<literal>option</literal>文字とその意味を示します:
37 </para> 49 </para>
38 <itemizedlist> 50 <table>
39 <listitem> 51 <tr>
40 <para>- : 左揃え, フィールド内では, 変換の結果.</para> 52 <th>- :</th>
41 </listitem> 53 <td>
42 <listitem> 54 左揃え, フィールド内では, 変換の結果.
43 <para>+ : (+または -)を指定する符号変換の結果を開始.</para> 55 </td>
44 </listitem> 56 </tr>
45 <listitem> 57 <tr>
46 <para>'空白' : 58 <th>+ :</th>
47 符号変換後の最初の文字が符号ではない場合に結果の 59 <td>
60 (+または -)を指定する符号変換の結果を開始.
61 </td>
62 </tr>
63 <tr>
64 <td style="white-space:nowrap"><emphasis role="bold">' ' :</emphasis></td>
65 <td>
66 (空白) 符号変換後の最初の文字が符号ではない場合に結果の
48 前に空白文字を付加します. 67 前に空白文字を付加します.
49 (空白) および +オプションが共に指定された場合, 68 (空白) および +オプションが共に指定された場合,
50 (空白) オプションは無視されます. 69 (空白) オプションは無視されます.
51 </para> 70 </td>
52 </listitem> 71 </tr>
53 <listitem> 72 <tr>
54 <para># : 別の形式に値を変換. 73 <th># :</th>
74 <td>
75 別の形式に値を変換.
55 <literal>c</literal>, <literal>d</literal>, <literal>i</literal>, 76 <literal>c</literal>, <literal>d</literal>, <literal>i</literal>,
56 <literal>s</literal>, および <literal>u</literal> 変換の場合, 77 <literal>s</literal>, および <literal>u</literal> 変換の場合,
57 <literal>#</literal>オプションの効果はありません. 78 <literal>#</literal>オプションの効果はありません.
@@ -64,10 +85,11 @@
64 <literal>g</literal> および 85 <literal>g</literal> および
65 <literal>G</literal> 変換の場合, 86 <literal>G</literal> 変換の場合,
66 末尾の0は結果から除かれません. 87 末尾の0は結果から除かれません.
67 </para> 88 </td>
68 </listitem> 89 </tr>
69 <listitem> 90 <tr>
70 <para>0 : 91 <th>0 :</th>
92 <td>
71 <literal>d</literal>, 93 <literal>d</literal>,
72 <literal>i</literal>, <literal>o</literal>, <literal>u</literal>, 94 <literal>i</literal>, <literal>o</literal>, <literal>u</literal>,
73 <literal>x</literal>, <literal>X</literal>, <literal>e</literal>, 95 <literal>x</literal>, <literal>X</literal>, <literal>e</literal>,
@@ -82,9 +104,9 @@
82 <literal>o</literal> <literal>u</literal>, <literal>x</literal>, 104 <literal>o</literal> <literal>u</literal>, <literal>x</literal>,
83 および <literal>X</literal> 変換の場合, 精度が指定されると, 105 および <literal>X</literal> 変換の場合, 精度が指定されると,
84 <literal>0</literal> フラグも無視されます. 106 <literal>0</literal> フラグも無視されます.
85 </para> 107 </td>
86 </listitem> 108 </tr>
87 </itemizedlist> 109 </table>
88 </listitem> 110 </listitem>
89 </itemizedlist> 111 </itemizedlist>
90 <para> 112 <para>
@@ -102,42 +124,69 @@
102 このパラメータは 0 (ゼロ)と扱われます. 124 このパラメータは 0 (ゼロ)と扱われます.
103 精度指定子: 125 精度指定子:
104 </para> 126 </para>
127 <para>
105 <itemizedlist> 128 <itemizedlist>
106 <listitem> 129 <listitem>
107 <para> 130 <literal>d</literal>,
108 <literal>d</literal>, 131 <literal>u</literal>, <literal>o</literal>, <literal>x</literal>, または
109 <literal>u</literal>, <literal>o</literal>, <literal>x</literal>, または 132 <literal>X</literal>変換に関する最小表示桁数
110 <literal>X</literal>変換に関する最小表示桁数
111 </para>
112 </listitem> 133 </listitem>
113 <listitem> 134 <listitem>
114 <para> 135 <literal>e</literal>, <literal>E</literal>, および <literal>f</literal>
115 <literal>e</literal>, <literal>E</literal>, および <literal>f</literal> 136 における小数点の後に表示する桁数
116 における小数点の後に表示する桁数
117 </para>
118 </listitem> 137 </listitem>
119 <listitem> 138 <listitem>
120 <para> 139 <literal>g</literal> および<literal>G</literal>変換における
121 <literal>g</literal> および<literal>G</literal>変換における 140 有効桁の最大値
122 有効桁の最大値
123 </para>
124 </listitem> 141 </listitem>
125 <listitem> 142 <listitem>
126 <para> 143 <literal>s</literal>変換において文字列から出力される
127 <literal>s</literal>変換において文字列から出力される 144 最大文字数
128 最大文字数
129 </para>
130 </listitem> 145 </listitem>
131 <listitem> 146 <listitem>
132 <para>適用される変換の種類を示す文字:</para> 147 適用される変換の種類を示す文字:
133 <itemizedlist> 148 <table>
134 <listitem> 149 <tr>
135 <para>% : 変換しません. %を表示.</para> 150 <th>% :</th>
136 </listitem> 151 <td>
137 <listitem> 152 変換しません. %を表示.
138 <para> 153 <note>
139 d,i: 整数 <literal>value</literal> を受け取り, 154 This may be useful for instance to print percentages, or
140 符号付き10進数表記に変換します. 155 to process some LaTeX expression including LaTeX comments
156 starting with "%", etc.
157 </note>
158 </td>
159 </tr>
160 <tr>
161 <th>s :</th>
162 <td>
163 Accepts a string or boolean <literal>value</literal>,
164 文字列から末尾または精度に示された文字数に達するまで,
165 文字に変換します.精度が指定されない場合,末尾までの全ての文字が
166 表示されます.
167 Input strings including some UTF-8 extended characters are supported.
168 Booleans are converted into 'T' or 'F'.
169 </td>
170 </tr>
171 <tr>
172 <th>c :</th>
173 <td>
174 Not supported.
175 </td>
176 </tr>
177 <tr>
178 <td colspan="2">
179 All following conversions accept any decimal numerical or boolean
180 input <literal>value</literal>. Only the real part of any input
181 complex number is considered. Booleans are implicitly converted
182 into 0 and 1.
183 </td>
184 </tr>
185 <tr>
186 <th>d, i :</th>
187 <td>
188 Converts the input <literal>value</literal> to a signed integer int32
189 notation. Conversions for input |Numbers| ≥ 2^31 are not reliable.
141 精度は表示される最小の桁数を指定します. 190 精度は表示される最小の桁数を指定します.
142 変換される値がより少ない桁数で表せる場合, 191 変換される値がより少ない桁数で表せる場合,
143 前にゼロを付加して拡張されます. 192 前にゼロを付加して拡張されます.
@@ -146,12 +195,13 @@
146 前に付加する文字をゼロとしてフィールド幅を指定すると, 195 前に付加する文字をゼロとしてフィールド幅を指定すると,
147 フィールド幅までの値では前にゼロを付加するパディングが 196 フィールド幅までの値では前にゼロを付加するパディングが
148 行われます. 197 行われます.
149 </para> 198 </td>
150 </listitem> 199 </tr>
151 <listitem> 200 <tr>
152 <para> 201 <th>u :</th>
153 u : 整数 <literal>value</literal> を受け取り, 202 <td>
154 符号なし10進数表記に変換します. 203 Converts the input <literal>value</literal> to an unsigned integer
204 uint32 notation. Conversions for input |Numbers| ≥ 2^32 are not reliable.
155 精度は表示される最小の桁数を指定します. 205 精度は表示される最小の桁数を指定します.
156 変換される値がより少ない桁数で表せる場合, 206 変換される値がより少ない桁数で表せる場合,
157 前にゼロを付加して拡張されます. 207 前にゼロを付加して拡張されます.
@@ -160,12 +210,13 @@
160 前に付加する文字をゼロとしてフィールド幅を指定すると, 210 前に付加する文字をゼロとしてフィールド幅を指定すると,
161 フィールド幅までの値では前にゼロを付加するパディングが 211 フィールド幅までの値では前にゼロを付加するパディングが
162 行われます. 212 行われます.
163 </para> 213 </td>
164 </listitem> 214 </tr>
165 <listitem> 215 <tr>
166 <para> 216 <th>o :</th>
167 o : 整数 <literal>value</literal> を受け取り, 217 <td>
168 符号なし8進数表記に変換します. 218 Converts the input <literal>value</literal> to an unsigned octal notation.
219 Conversions for input |Numbers| ≥ 2^32 are not reliable.
169 精度は表示される最小の桁数を指定します. 220 精度は表示される最小の桁数を指定します.
170 変換される値がより少ない桁数で表せる場合, 221 変換される値がより少ない桁数で表せる場合,
171 前にゼロを付加して拡張されます. 222 前にゼロを付加して拡張されます.
@@ -174,12 +225,14 @@
174 前に付加する文字をゼロとしてフィールド幅を指定すると, 225 前に付加する文字をゼロとしてフィールド幅を指定すると,
175 フィールド幅までの値では前にゼロを付加するパディングが 226 フィールド幅までの値では前にゼロを付加するパディングが
176 行われます. フィールド幅に8進数を使用することはできません. 227 行われます. フィールド幅に8進数を使用することはできません.
177 </para> 228 </td>
178 </listitem> 229 </tr>
179 <listitem> 230 <tr>
180 <para> 231 <th>x, X :</th>
181 x, X : 整数 <literal>value</literal> を受け取り, 232 <td>
182 符号なし16進数表記に変換します.<literal>x</literal>変換では, 233 Converts the input <literal>value</literal> to an unsigned hexadecimal
234 notation. Conversions for input |Numbers| ≥ 2^32 are not reliable.
235 <literal>x</literal>変換では,
183 文字``abcdef''が使用されます;<literal>X</literal>変換では, 236 文字``abcdef''が使用されます;<literal>X</literal>変換では,
184 文字``ABCDEF''が使用されます. 237 文字``ABCDEF''が使用されます.
185 精度はは表示される最小の桁数を指定します. 238 精度はは表示される最小の桁数を指定します.
@@ -190,57 +243,59 @@
190 前に付加する文字をゼロとしてフィールド幅を指定すると, 243 前に付加する文字をゼロとしてフィールド幅を指定すると,
191 フィールド幅までの値では前にゼロを付加するパディングが 244 フィールド幅までの値では前にゼロを付加するパディングが
192 行われます. 245 行われます.
193 </para> 246 </td>
194 </listitem> 247 </tr>
195 <listitem> 248 <tr>
196 <para> 249 <th>f :</th>
197 f : float または double の<literal>value</literal> を受け取り, 250 <td>
198 %[\-]<literal>ddd.ddd</literal>形式の10進数表記に変換します. 251 Converts the input <literal>value</literal> to a decimal notation in
252 the format %[\-]<literal>ddd.ddd</literal>.
199 小数点以下の桁数は,精度指定子に等しくなります. 253 小数点以下の桁数は,精度指定子に等しくなります.
200 </para> 254 <itemizedlist>
201 <itemizedlist> 255 <listitem>
202 <listitem> 256 精度が指定されない場合, 6桁が出力されます.
203 <para>精度が指定されない場合, 6桁が出力されます.</para> 257 </listitem>
204 </listitem> 258 <listitem>
205 <listitem> 259 精度がゼロの場合, 小数点は表示されず,
206 <para>精度がゼロの場合, 小数点は表示されず,
207 システムは<literal>value</literal>に最も近い整数に丸めた数を 260 システムは<literal>value</literal>に最も近い整数に丸めた数を
208 出力します. 261 出力します.
209 </para> 262 </listitem>
210 </listitem> 263 <listitem>
211 <listitem> 264 小数点が出力される場合,最低でも1桁がその前に出力されます.
212 <para>小数点が出力される場合,最低でも1桁がその前に出力されます.</para> 265 </listitem>
213 </listitem> 266 </itemizedlist>
214 </itemizedlist> 267 </td>
215 </listitem> 268 </tr>
216 <listitem> 269 <tr>
217 <para> 270 <th>e, E :</th>
218 e, E : 実数を受け取り,指数形式%[\-]<literal>d.ddde</literal>+/\-<literal>dd</literal> 271 <td>
219 に変換します. 272 Converts the input <literal>value</literal> to the exponential
273 form %[\-]<literal>d.ddde</literal>+/\-<literal>dd</literal>.
220 小数点の前に1桁があり,小数点の後の桁数は精度指定子に等しくなります. 274 小数点の前に1桁があり,小数点の後の桁数は精度指定子に等しくなります.
221 </para> 275 <itemizedlist>
222 <itemizedlist> 276 <listitem>
223 <listitem> 277 精度が指定されない場合, 6桁が出力されます.
224 <para>精度が指定されない場合, 6桁が出力されます.</para> 278 </listitem>
225 </listitem> 279 <listitem>
226 <listitem> 280 精度がゼロの場合, 小数点は表示されません.
227 <para>精度がゼロの場合, 小数点は表示されません. 281 </listitem>
228 </para> 282 <listitem>
229 </listitem>
230 <listitem>
231 <para>
232 <literal>E</literal> 変換文字の場合, 283 <literal>E</literal> 変換文字の場合,
233 指数の前の e の代わりに E を付けた数値を出力します. 284 指数の前の e の代わりに E を付けた数値を出力します.
234 指数には常に2桁以上が含まれます. 285 指数には常に2桁以上が含まれます.
235 値が 0 の場合, 指数は 0 となります. 286 値が 0 の場合, 指数は 0 となります.
236 </para> 287 </listitem>
237 </listitem> 288 </itemizedlist>
238 </itemizedlist> 289 </td>
239 </listitem> 290 </tr>
240 <listitem> 291 <tr>
241 <para>g, G : 実数を受け取り,有効桁数を指定する精度を付けた 292 <td style="white-space:nowrap"><emphasis role="bold">g, G :</emphasis></td>
293 <td>
294 有効桁数を指定する精度を付けた
242 <literal>e</literal>, <literal>E</literal>, または 295 <literal>e</literal>, <literal>E</literal>, または
243 <literal>f</literal>変換文字の形式に変換します. 296 <literal>f</literal>変換文字の形式に変換します.
297 Booleans are converted into 0 and 1. Only the real part of complex
298 numbers is considered.
244 末尾のゼロは結果から削除されます. 299 末尾のゼロは結果から削除されます.
245 小数点は数字が続く場合にのみ表示されます. 300 小数点は数字が続く場合にのみ表示されます.
246 使用される形式は変換される値に依存します. 301 使用される形式は変換される値に依存します.
@@ -248,24 +303,14 @@
248 精度より大きいか等しい場合に, 303 精度より大きいか等しい場合に,
249 <literal>e</literal> (使用されるフラグが<literal>G</literal>の場合は 304 <literal>e</literal> (使用されるフラグが<literal>G</literal>の場合は
250 <literal>E</literal>)形式が使用されます. 305 <literal>E</literal>)形式が使用されます.
251 </para> 306 </td>
252 </listitem> 307 </tr>
253 <listitem> 308 </table>
254 <para>c : 整数値を受け取り,文字に変換します.</para>
255 </listitem>
256 <listitem>
257 <para>
258 s : 文字列 <literal>value</literal> を受け取り,
259 文字列から末尾または精度に示された文字数に達するまで,
260 文字に変換します.精度が指定されない場合,末尾までの全ての文字が
261 表示されます.
262 </para>
263 </listitem>
264 </itemizedlist>
265 </listitem> 309 </listitem>
266 </itemizedlist> 310 </itemizedlist>
267 <para>フィールド幅または精度は, 311 </para>
268 桁文字の代わりに<literal>*</literal> (アスタリスク)で 312 <para>
313 フィールド幅または精度は, 桁文字の代わりに<literal>*</literal> (アスタリスク)で
269 示すことができます. 314 示すことができます.
270 この場合,整数 <literal>value</literal>パラメータは 315 この場合,整数 <literal>value</literal>パラメータは
271 フィールド幅または精度を指定します. 316 フィールド幅または精度を指定します.
@@ -284,21 +329,43 @@
284 </para> 329 </para>
285 <para>指数形式 %e の表示はプレットフォームに依存し, 330 <para>指数形式 %e の表示はプレットフォームに依存し,
286 指数の桁数は異なります. 331 指数の桁数は異なります.
332 <informaltable border="1">
333 <tr>
334 <td>プラットフォーム</td>
335 <td>例: msprintf("%e",1.23e4)</td>
336 </tr>
337 <tr>
338 <td>Windows</td>
339 <td>1.23000e+004</td>
340 </tr>
341 <tr>
342 <td>Linux/Mac OS</td>
343 <td>1.23000e+04</td>
344 </tr>
345 </informaltable>
346 </para>
347 <para>
348 <emphasis role="bold">Special escaped sequenced</emphasis> are supported in C-format
349 strings:
350 <table>
351 <tr>
352 <th>\n :</th>
353 <td>Go to Next line (line feed)</td>
354 </tr>
355 <tr>
356 <th>\r :</th>
357 <td>Return: go to the head of current line (for overprinting)</td>
358 </tr>
359 <tr>
360 <th>\t :</th>
361 <td>horizontal Tab</td>
362 </tr>
363 <tr>
364 <th>\\ :</th>
365 <td>print a backslash \</td>
366 </tr>
367 </table>
287 </para> 368 </para>
288 <informaltable border="1">
289 <tr>
290 <td>プラットフォーム</td>
291 <td>例: msprintf("%e",1.23e4)</td>
292 </tr>
293 <tr>
294 <td>Windows</td>
295 <td>1.23000e+004</td>
296 </tr>
297 <tr>
298 <td>Linux/Mac OS</td>
299 <td>1.23000e+04</td>
300 </tr>
301 </informaltable>
302 </refsection> 369 </refsection>
303 <refsection> 370 <refsection>
304 <title>例</title> 371 <title>例</title>
@@ -320,7 +387,45 @@ mprintf('a float (exponential form): %3.2e\n', %pi);
320mprintf('a float (exponential form): %3.2g\n', %pi); 387mprintf('a float (exponential form): %3.2g\n', %pi);
321mprintf('a character: %c\n', 'a'); 388mprintf('a character: %c\n', 'a');
322mprintf('a character: %c\n', 'aaa'); 389mprintf('a character: %c\n', 'aaa');
323 ]]></programlisting> 390 ]]></programlisting>
391 <para/>
392 <para>
393 With input booleans:
394 </para>
395 <programlisting role="example"><![CDATA[
396mprintf("\n%%d: %d, %%u: %u, %%o: %o, %%f: %f, %%e: %e, %%s: %s\n" + ..
397 "%%d: %d, %%u: %u, %%o: %o, %%f: %f, %%e: %e, %%s: %s\n", ..
398 %T, %T, %T, %T, %T, %T, %F, %F, %F, %F, %F, %F);
399 ]]></programlisting>
400 <screen><![CDATA[
401%d: 1, %u: 1, %o: 1, %f: 1.000000, %e: 1.000000e+00, %s: T
402%d: 0, %u: 0, %o: 0, %f: 0.000000, %e: 0.000000e+00, %s: F
403]]></screen>
404 <para/>
405 <para>
406 With numbered placeholders:
407 </para>
408 <programlisting role="example"><![CDATA[
409mprintf("%2$s is %1$d-year old.\n", 32, "Peter");
410 ]]></programlisting>
411 <screen><![CDATA[
412Peter is 32-year old.
413]]></screen>
414 <para/>
415 <para>
416 With escaped sequences and UTF-8 extended characters:
417 </para>
418 <programlisting role="example"><![CDATA[
419mprintf("The path T:\\abc does not exist.\n");
420mprintf("abcdefghijk\tαβδ\tεϵ\tζηθικλ\rABCDE\n");
421 ]]></programlisting>
422 <screen><![CDATA[
423--> mprintf("The path T:\\abc does not exist.\n");
424The path T:\abc does not exist
425
426--> mprintf("abcdefghijk\tαβδ\tεϵ\tζηθικλ\rABCDE\n");
427ABCDEfghijk αβδ εϵ ζηθικλ
428]]></screen>
324 </refsection> 429 </refsection>
325 <refsection role="see also"> 430 <refsection role="see also">
326 <title>参照</title> 431 <title>参照</title>
@@ -336,4 +441,21 @@ mprintf('a character: %c\n', 'aaa');
336 </member> 441 </member>
337 </simplelist> 442 </simplelist>
338 </refsection> 443 </refsection>
444 <refsection role="history">
445 <title>履歴</title>
446 <revhistory>
447 <revision>
448 <revnumber>6.1.0</revnumber>
449 <revdescription>
450 Numbered placeholders "%n$.." are supported.
451 </revdescription>
452 </revision>
453 <revision>
454 <revnumber>6.1.1</revnumber>
455 <revdescription>
456 Input boolean data can be converted.
457 </revdescription>
458 </revision>
459 </revhistory>
460 </refsection>
339</refentry> 461</refentry>
diff --git a/scilab/modules/output_stream/help/pt_BR/printf_conversion.xml b/scilab/modules/output_stream/help/pt_BR/printf_conversion.xml
index ec8f2e1..4ec5be5 100644
--- a/scilab/modules/output_stream/help/pt_BR/printf_conversion.xml
+++ b/scilab/modules/output_stream/help/pt_BR/printf_conversion.xml
@@ -2,8 +2,8 @@
2<!-- 2<!--
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) XXXX-2008 - INRIA 4 * Copyright (C) XXXX-2008 - INRIA
5 *
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises 5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2021 - Samuel GOUGEON
7 * 7 *
8 * This file is hereby licensed under the terms of the GNU GPL v2.0, 8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1. 9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -13,7 +13,10 @@
13 * along with this program. 13 * along with this program.
14 * 14 *
15 --> 15 -->
16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="printf_conversion" xml:lang="pt"> 16<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17 xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
18 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19 xmlns:scilab="http://www.scilab.org" xml:id="printf_conversion" xml:lang="pt">
17 <refnamediv> 20 <refnamediv>
18 <refname>printf_conversion</refname> 21 <refname>printf_conversion</refname>
19 <refpurpose>Especificações de conversão de mprintf, msprintf, 22 <refpurpose>Especificações de conversão de mprintf, msprintf,
@@ -32,57 +35,76 @@
32 </listitem> 35 </listitem>
33 <listitem> 36 <listitem>
34 <para> 37 <para>
35 Zero ou mais <literal>options</literal> (opções), que modificam 38 An optional integer n ≥ 1 followed by "$". n is the index of the input data
36 o significado da especificação de conversão. A lista seguinte contem 39 to substitute to the placeholder, in the msprintf, mprintf .. list of input data.
37 os caracteres <literal>option</literal> e seus significados: 40 In a format string, placeholders are either all numbered or all non-numbered.
38 </para> 41 A given numbered placeholder can be used only once in its C-format string
39 </listitem> 42 (Scilab limitation).
40 <listitem>
41 <para>Alinhe à esquerda, dentro do campo, o resultado da
42 conversão.
43 </para>
44 </listitem>
45 <listitem>
46 <para>Comece o resultado de uma conversão com sinal com um sinal (+ ou
47 -).
48 </para> 43 </para>
49 </listitem> 44 </listitem>
50 <listitem> 45 <listitem>
51 <para>Prefixe um caractere de espaço ao resultado se o primeiro 46 <para>
52 caractere de uma conversão com sinal não for um sinal. Se ambas as 47 Zero ou mais <literal>options</literal> (opções), que modificam
53 opções (espaço) e + aparecerem, a opção (space) é ignorada. 48 o significado da especificação de conversão. A lista seguinte contem
54 </para> 49 os caracteres <literal>option</literal> e seus significados:
55 </listitem>
56 <listitem>
57 <para>Converta o valor para uma forma alternativa. Para as conversões
58 <literal>c</literal>, <literal>d</literal>, <literal>i</literal>,
59 <literal>s</literal>, e <literal>u</literal>, a opção
60 <literal>#</literal> não possui efeito. Para a conversão
61 <literal>o</literal>, <literal>#</literal> aumenta a precisão para
62 forçar o primeiro dígito do resultado a ser 0 (zero). Para as
63 conversões <literal>x</literal> e <literal>X</literal>, um valor
64 não-nulo possui 0x ou 0X prefixado a ele. Para as conversões
65 <literal>e, E, f, g,</literal> e <literal>G</literal>, o resultado
66 sempre contém ponto decimal, Mesmo que nenhum dígito o siga. Para as
67 conversões <literal>g</literal> e <literal>G</literal>, zeros por
68 último não são removidos.
69 </para>
70 </listitem>
71 <listitem>
72 <para>Aumente a largura do campo utilizando zeros à esquerda (seguindo
73 qualquer indicação de sinal ou base) para as conversões
74 <literal>d</literal>, <literal>i</literal>, <literal>o</literal>,
75 <literal>u</literal>, <literal>x</literal>, <literal>X</literal>,
76 <literal>e</literal>, <literal>E</literal>, <literal>f</literal>,
77 <literal>g</literal>, e <literal>G</literal>; nenhum aumento de espaço
78 é realizado. Se ambos os indicadores <literal>0</literal> e
79 <literal>\-</literal> (barra) aparecerem, o indicador
80 <literal>0</literal> é ignorado. Para as conversões
81 <literal>d</literal>, <literal>i</literal>, <literal>o</literal>
82 <literal>u</literal>, <literal>x</literal>, e <literal>X</literal>, se
83 uma precisão for especificada, o indicador <literal>0</literal> também
84 é ignorado.
85 </para> 50 </para>
51 <table>
52 <tr>
53 <th>- :</th>
54 <td>
55 Alinhe à esquerda, dentro do campo, o resultado da conversão.
56 </td>
57 </tr>
58 <tr>
59 <th>+ :</th>
60 <td>
61 Comece o resultado de uma conversão com sinal com um sinal (+ ou -).
62 </td>
63 </tr>
64 <tr>
65 <td style="white-space:nowrap"><emphasis role="bold">' ' :</emphasis></td>
66 <td>
67 (space) Prefixe um caractere de espaço ao resultado se o primeiro
68 caractere de uma conversão com sinal não for um sinal. Se ambas as
69 opções (espaço) e + aparecerem, a opção (space) é ignorada.
70 </td>
71 </tr>
72 <tr>
73 <th># :</th>
74 <td>
75 Converta o valor para uma forma alternativa. Para as conversões
76 <literal>c</literal>, <literal>d</literal>, <literal>i</literal>,
77 <literal>s</literal>, e <literal>u</literal>, a opção
78 <literal>#</literal> não possui efeito. Para a conversão
79 <literal>o</literal>, <literal>#</literal> aumenta a precisão para
80 forçar o primeiro dígito do resultado a ser 0 (zero). Para as
81 conversões <literal>x</literal> e <literal>X</literal>, um valor
82 não-nulo possui 0x ou 0X prefixado a ele. Para as conversões
83 <literal>e, E, f, g,</literal> e <literal>G</literal>, o resultado
84 sempre contém ponto decimal, Mesmo que nenhum dígito o siga. Para as
85 conversões <literal>g</literal> e <literal>G</literal>, zeros por
86 último não são removidos.
87 </td>
88 </tr>
89 <tr>
90 <th>0 :</th>
91 <td>
92 Aumente a largura do campo utilizando zeros à esquerda (seguindo
93 qualquer indicação de sinal ou base) para as conversões
94 <literal>d</literal>, <literal>i</literal>, <literal>o</literal>,
95 <literal>u</literal>, <literal>x</literal>, <literal>X</literal>,
96 <literal>e</literal>, <literal>E</literal>, <literal>f</literal>,
97 <literal>g</literal>, e <literal>G</literal>; nenhum aumento de espaço
98 é realizado. Se ambos os indicadores <literal>0</literal> e
99 <literal>\-</literal> (barra) aparecerem, o indicador
100 <literal>0</literal> é ignorado. Para as conversões
101 <literal>d</literal>, <literal>i</literal>, <literal>o</literal>
102 <literal>u</literal>, <literal>x</literal>, e <literal>X</literal>, se
103 uma precisão for especificada, o indicador <literal>0</literal> também
104 é ignorado.
105 </td>
106 </tr>
107 </table>
86 </listitem> 108 </listitem>
87 <listitem> 109 <listitem>
88 <para>Um string de dígitos decimais opcional que especifica a largura 110 <para>Um string de dígitos decimais opcional que especifica a largura
@@ -101,26 +123,22 @@
101 </para> 123 </para>
102 <itemizedlist> 124 <itemizedlist>
103 <listitem> 125 <listitem>
104 <para>O número mínimo de dígitos a aparecerem nas conversões 126 O número mínimo de dígitos a aparecerem nas conversões
105 <literal>d</literal>, <literal>u</literal>, <literal>o</literal>, 127 <literal>d</literal>, <literal>u</literal>, <literal>o</literal>,
106 <literal>x</literal>, ou <literal>X</literal> 128 <literal>x</literal>, ou <literal>X</literal>.
107 </para>
108 </listitem> 129 </listitem>
109 <listitem> 130 <listitem>
110 <para>O número de dígitos a aparecerem após o ponto decimal nas 131 O número de dígitos a aparecerem após o ponto decimal nas
111 conversões <literal>e</literal>, <literal>E</literal>, e 132 conversões <literal>e</literal>, <literal>E</literal>, e
112 <literal>f</literal> 133 <literal>f</literal>.
113 </para>
114 </listitem> 134 </listitem>
115 <listitem> 135 <listitem>
116 <para>O número máximo de dígitos significativos para as conversões 136 O número máximo de dígitos significativos para as conversões
117 <literal>g</literal> e <literal>G</literal> 137 <literal>g</literal> e <literal>G</literal>.
118 </para>
119 </listitem> 138 </listitem>
120 <listitem> 139 <listitem>
121 <para>O número máximo de caracteres a serem impressos a partir de um 140 O número máximo de caracteres a serem impressos a partir de um
122 string em uma convesão <literal>s</literal> 141 string em uma convesão <literal>s</literal>.
123 </para>
124 </listitem> 142 </listitem>
125 </itemizedlist> 143 </itemizedlist>
126 </listitem> 144 </listitem>
@@ -128,126 +146,163 @@
128 <para>O caractere que indica o tipo de conversão a ser 146 <para>O caractere que indica o tipo de conversão a ser
129 aplicada: 147 aplicada:
130 </para> 148 </para>
131 </listitem> 149 <table>
132 <listitem> 150 <tr>
133 <para>Não realiza conversão. Exibe %.</para> 151 <th>% :</th>
134 </listitem> 152 <td>
135 <listitem> 153 Não realiza conversão. Exibe %..
136 <para>Aceita um valor inteiro e o converte para notação decimal com 154 <note>
137 sinal. A precisão especifica o número mínimo de dígitos a aparecer. Se 155 This may be useful for instance to print percentages, or
138 o valor sendo convertido puder ser representado em menos dígitos, ele 156 to process some LaTeX expression including LaTeX comments
139 é expandido com zeros à esquerda. A precisão padrão é 1. O resultado 157 starting with "%", etc.
140 de se converter um valor zero com uma precisão de zero é um string 158 </note>
141 nulo. A especificação de uma largura de campo com zero como caractere 159 </td>
142 mais à esquerda faz com que o valor da largura do campo seja 160 </tr>
143 preenchido com zeros à esquerda. 161 <tr>
144 </para> 162 <th>s :</th>
145 </listitem> 163 <td>
146 <listitem> 164 Accepts a string or boolean <literal>value</literal> e exibe caracteres
147 <para>Aceita um valor inteiro e o converte para a notação decimal sem 165 do string até o fim ou até que o número de caracteres indicados pela
148 sinal. A precisão especifica o número mínimo de dígitos a aparecer. Se 166 precisão seja alcançado. Se nenhuma precisão for especificada, todos os
149 o valor sendo convertido puder ser representado em menos dígitos, ele 167 caracteres até o fim são exibidos.
150 é expandido com zeros à esquerda. A precisão padrão é 1. O resultado 168 UTF-8 extended characters are supported in input strings.
151 de se converter um valor zero com uma precisão de zero é um string 169 Booleans are converted into 'T' or 'F'.
152 nulo. A especificação de uma largura de campo com zero como caractere 170 </td>
153 mais à esquerda faz com que o valor da largura do campo seja 171 </tr>
154 preenchido com zeros à esquerda. 172 <tr>
155 </para> 173 <th>c :</th>
156 </listitem> 174 <td>Not supported.
157 <listitem> 175 </td>
158 <para>Aceita um valor inteiro e o converte para a sua notação octal 176 </tr>
159 sem sinal. A precisão especifica o número mínimo de dígitos a 177 <tr>
160 aparecer. Se o valor sendo convertido puder ser representado em menos 178 <td colspan="2">
161 dígitos, ele é expandido com zeros à esquerda. A precisão padrão é 1. 179 All following conversions accept any decimal numerical or boolean
162 O resultado de se converter um valor zero com uma precisão de zero é 180 input <literal>value</literal>. Only the real part of any input
163 um string nulo. A especificação de uma largura de campo com zero como 181 complex number is considered. Booleans are implicitly converted
164 caractere mais à esquerda faz com que o valor da largura do campo seja 182 into 0 and 1.
165 preenchido com zeros à esquerda. Não é implicado um valor octal para a 183 </td>
166 largura do campo. 184 </tr>
167 </para> 185 <tr>
168 </listitem> 186 <th>d,i :</th>
169 <listitem> 187 <td>
170 <para>Aceita um valor inteiro e o converte para a sua notação 188 Converts the input <literal>value</literal>