summaryrefslogtreecommitdiffstats
path: root/kspread/extensions/conversion.xml
blob: 03a58b3ebf555dfb49dc2b0be4a0f716635c4869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
<!DOCTYPE KSpreadFunctions>
<KSpreadFunctions>

  <Group>
    <GroupName>Conversion</GroupName>

    <Function>
      <Name>BOOL2STRING</Name>
      <Type>String</Type>
      <Parameter>
        <Comment>Bool value to convert</Comment>
        <Type range="false">Boolean</Type>
      </Parameter>
      <Help>
        <Text>The BOOL2STRING() function returns a string value for a given boolean value. This method is intended for using a boolean in methods which require a string</Text>
        <Syntax>BOOL2STRING(value)</Syntax>
	<Example>BOOL2STRING(true) returns "True"</Example>
	<Example>BOOL2STRING(false) returns "False"</Example>
        <Example>upper(BOOL2STRING(find("nan";"banana"))) returns TRUE</Example>
      </Help>
    </Function>

    <Function>
      <Name>INT2BOOL</Name>
      <Type>Boolean</Type>
      <Parameter>
        <Comment>Integer value to convert</Comment>
        <Type range="false">Int</Type>
      </Parameter>
      <Help>
        <Text>The INT2BOOL() function returns a boolean value for a given integer number. This method is intended for using an integer in methods which require a boolean. It only accepts 0 or 1. If any other value is given, false is returned.</Text>
        <Syntax>INT2BOOL(value)</Syntax>
        <Example>INT2BOOL(1) returns true</Example>
        <Example>INT2BOOL(0) returns false</Example>
        <Example>OR(INT2BOOL(1); false) returns true</Example>
        <Related>BOOL2INT</Related>
      </Help>
    </Function>

    <Function>
      <Name>BOOL2INT</Name>
      <Type>Int</Type>
      <Parameter>
        <Comment>Bool value to convert</Comment>
        <Type range="false">Boolean</Type>
      </Parameter>
      <Help>
        <Text>The BOOL2INT() function returns an integer value for a given boolean value. This method is intended for using a boolean value in methods which require an integer.</Text>
        <Syntax>BOOL2INT(value)</Syntax>
        <Example>BOOL2INT(True) returns 1</Example>
        <Example>BOOL2INT(False) returns 0</Example>
        <Related>INT2BOOL</Related>
      </Help>
    </Function>

    <Function>
      <Name>NUM2STRING</Name>
      <Type>String</Type>
      <Parameter>
        <Comment>Number to convert into string</Comment>
        <Type range="false">Float</Type>
      </Parameter>
      <Help>
        <Text>The NUM2STRING() function returns a string value for a given number. Note that KSpread can auto-covert numbers to strings if needed, so this function should rarely be needed.</Text>
        <Syntax>NUM2STRING(value)</Syntax>
        <Example>NUM2STRING(10) returns "10"</Example>
        <Example>NUM2STRING(2.05) returns "2.05"</Example>
        <Example>=find("101";NUM2STRING(A1)) (A1 = 2.010102) returns True</Example>
        <Related>STRING</Related>
      </Help>
    </Function>

    <Function>
      <Name>STRING</Name>
      <Type>String</Type>
      <Parameter>
        <Comment>Number to convert into string</Comment>
        <Type range="false">Float</Type>
      </Parameter>
      <Help>
        <Text>The STRING() function returns a string value for a given number. It is the same as the NUM2STRING function.</Text>
        <Related>NUM2STRING</Related>
      </Help>
    </Function>

    <Function>
      <Name>CHARTOASCII</Name>
      <Type>Int</Type>
      <Parameter>
        <Comment>A one character string to convert</Comment>
        <Type>String</Type>
      </Parameter>
      <Help>
        <Text>The CHARTOASCII() function returns the ASCII code for the given character.</Text>
        <Syntax>CHARTOASCII(value)</Syntax>
        <Example>CHARTOASCII("v") returns 118</Example>
        <Example>CHARTOASCII(r) is an error. The character must be in quotes.</Example>
      </Help>
    </Function>

    <Function>
      <Name>ASCIITOCHAR</Name>
      <Type>String</Type>
      <Parameter>
        <Comment>The ASCII values to convert</Comment>
        <Type>Int</Type>
      </Parameter>
      <Help>
        <Text>The ASCIITOCHAR() function returns the character for each given ASCII code</Text>
        <Syntax>ASCIITOCHAR(value)</Syntax>
        <Example>ASCIITOCHAR(118) returns "v"</Example>
        <Example>ASCIITOCHAR(75; 68; 69) returns "KDE"</Example>
      </Help>
    </Function>

    <Function>
      <Name>POLR</Name>
      <Type>Double</Type>
      <Parameter>
	<Comment>Value in X</Comment>
	<Type>Double</Type>
      </Parameter>
      <Parameter>
	<Comment>Value in Y</Comment>
	<Type>Double</Type>
      </Parameter>
      <Help>
	<Text>The POLR() function returns the radius corresponding to the position of a point in a cartesian landmark.</Text>
	<Syntax>POLR(X;Y)</Syntax>
	<Example>POLR(12;12) returns 16.9705</Example>
	<Example>POLR(12;0) returns 12</Example>
        <Related>POLA</Related>
        <Related>CARX</Related>
        <Related>CARY</Related>
      </Help>
    </Function>

    <Function>
      <Name>POLA</Name>
      <Type>Double</Type>
      <Parameter>
	<Comment>Value in X</Comment>
	<Type>Double</Type>
      </Parameter>
      <Parameter>
	<Comment>Value in Y</Comment>
	<Type>Double</Type>
      </Parameter>
      <Help>
	<Text>The POLA() function returns the angle (in radians) corresponding to the position of a point in a cartesian landmark.</Text>
	<Syntax>POLA(X;Y)</Syntax>
	<Example>POLA(12;12) returns 0.78539816</Example>
	<Example>POLA(12;0) returns 0</Example>
            <Example>POLA(0;12) returns 1.5707</Example>
        <Related>POLR</Related>
        <Related>CARX</Related>
        <Related>CARY</Related>
      </Help>
    </Function>

    <Function>
      <Name>CARX</Name>
      <Type>Double</Type>
      <Parameter>
	<Comment>Radius</Comment>
	<Type>Double</Type>
      </Parameter>
      <Parameter>
	<Comment>Angle (radians)</Comment>
	<Type>Double</Type>
      </Parameter>
      <Help>
	<Text>The CARX() function returns the X position corresponding to the position of a point in a polar landmark.</Text>
	<Syntax>CARX(Radius;Angle)</Syntax>
	<Example>CARX(12;1.5707) returns 0.00115592</Example>
	<Example>CARX(12;0) returns 12</Example>
        <Related>CARY</Related>
        <Related>POLA</Related>
        <Related>POLR</Related>
      </Help>
    </Function>

    <Function>
      <Name>DECSEX</Name>
      <Type>Double</Type>
      <Parameter>
	<Comment>Value</Comment>
	<Type>Double</Type>
      </Parameter>
      <Help>
        <Text>The DECSEX() function converts a double value to a time value.</Text>
        <Syntax>DECSEX(double)</Syntax>
        <Example>DECSEX(1.6668) returns 1:40 </Example>
        <Example>DECSEX(7.8) returns 7:47</Example>
      </Help>
    </Function>

    <Function>
      <Name>SEXDEC</Name>
      <Type>Double</Type>
      <Parameter>
	<Comment>Hours</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Minutes</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Seconds</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
        <Text>The SEXDEC() function returns a decimal value. You can also supply a time value.</Text>
        <Syntax>SEXDEC(time value) or SEXDEC(hours;minutes;seconds)</Syntax>
        <Example>SEXDEC(1;5;7) returns 1.0852778 </Example>
        <Example>DECSEX("8:05") returns 8.08333333</Example>
      </Help>
    </Function>

    <Function>
      <Name>CARY</Name>
      <Type>Double</Type>
      <Parameter>
	<Comment>Radius</Comment>
	<Type>Double</Type>
      </Parameter>
      <Parameter>
	<Comment>Angle (radians)</Comment>
	<Type>Double</Type>
      </Parameter>
      <Help>
        <Text>The CARY() function returns the Y position corresponding to the position of a point in a polar landmark.</Text>
        <Syntax>CARY(Radius;Angle)</Syntax>
        <Example>CARY(12;1.5707) returns 12</Example>
        <Example>CARY(12;0) returns 0</Example>
        <Related>CARX</Related>
        <Related>POLA</Related>
        <Related>POLR</Related>
      </Help>
    </Function>

 <Function>
      <Name>ROMAN</Name>
      <Type>String</Type>
      <Parameter>
	<Comment>Number</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
        <Text>The ROMAN() function returns the number in roman format. Number should be positive and entire.</Text>
        <Syntax>ROMAN(Number)</Syntax>
        <Example>ROMAN(99) returns "XCIX"</Example>
        <Example>ROMAN(-55) returns "Err"</Example>
        <Related>ARABIC</Related>
      </Help>
    </Function>

    <Function>
      <Name>ARABIC</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Numeral</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
        <Text>The ARABIC() function converts a roman numeral into a number.</Text>
        <Syntax>ARABIC(Numeral)</Syntax>
        <Example>ARABIC("IV") returns 4</Example>
        <Example>ARABIC("XCIX") returns 99</Example>
        <Related>ROMAN</Related>
      </Help>
    </Function>

  </Group>

</KSpreadFunctions>