f$FtoS (f$ZahlZuText)
f$FtoS (f$ZahlZuText)
Convert a number into a string. The ’.’ is used as decimal separator. If no format is specified, integer values will be produced without decimal places and other values with six decimal places.
If text is entered instead of a number, a syntax error is not reported and the text is returned.
The format has the following syntax:
%[flags] [width] [.precision] [{h | l | I64 | L}]type
flags:
0 : leading zeros are entered up to the specified length.
+ : + or – is always written before the number
width: minimum number of characters to be produced
precision: numerical precision This corresponds to the number of decimal places when using floating values.
type: type of number:
c : individual character
d : integer
f : decimal
x : output as hexadecimal string (lower case)
X : output as hexadecimal string (upper case)
Syntax: | Text = f$FtoS( Number[, Formattext] ) | ||
| Argument | Type | Meaning |
| Number | Decimal | Number to be converted |
| Formattext (Optional) | String | Instruction text according to which the output is formatted |
Result: | String | Number as formatted text | |
Example: | Number as formatted textàText = '12' Text = f$FtoS( 89.358, '%0.2lf' ) → Text = '89.36' Text = f$FtoS( 26, '%04.0lf' ) → Text = '0026' | ||
With the format text ’%c’ you can enter a special character into a text using ASCII number code, e.g. a line break can be made in this way:
Break = f$FtoS(13,’%c’) |
The resulting string then consists of exactly one character - the line break.