HELP: String representation of an floating point number TYPE: OBJECT SYNTAX: STR(CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL,SEPARATOR=SYSTEM/PERIOD/COMMA/APOSTROPHE,GROUPSEPARATOR/MARKER=num/NON/OFF/SYSTEM/PERIOD/COMMA/SPACE/APOSTROPHE,VALUE='str',ALLOWTRUNC)
Reads a string representation of an real number. The result is an FL5-internal neutral real number representation which can be converted to any of the supported target real number representations by a corresponding write converter.
The string must be in decimal (base 10) format.
The CHRSET parameter must match the character set of the string. If no character set is specified, the system's default character set is assumed. All character sets supported by the character conversion module can be used, including multi-byte charsets.
If the string has some leading or trailing whitespace characters, they are ignored.
The SEPARATOR parameter specifies the character that separates integral and fractional portions of the number (i.e. period or comma). If not specified an auto detection is done. The automatic determination is not 100% clear. If it is not possible to clearly identify which character serves as the separator, the previous setting is used; if nothing has been recognized to date, the system defaults are used. We therefore recommend setting one of the separators to the correct value. This saves the expensive auto-recognition and misinterpretation of the numbers, which results in the following examples.
123 - don't need correct separators 1.234 - this is not unique it could be 1234 oder 1.234 1.23 - this is unique for fractional separator '.' 1,2 - this is unique for fractional separator ',' 1.2345 - this is unique for fractional separator '.' 12.234 - this is not unique 123.456 - this is also not unique 1.234,456 - this is unique for fractional separator ',' 1.234.456 - this is unique for group separator '.'
With the system defaults the read numbers are expected to be in the locale-dependent default number format (e.g. environment variable LC_NUMERIC on Linux). The auto detection is only supported for single byte ASCII, EBDIC oder UTF-8 character strings.
The VALUE parameter, defines a default float in local char set and decimal base and period as floating point separator. An empty string will be replaced by default value and don't result in an error anymore.
NUMBER: CHRSET=NONE/SYSTEM/ASCII/UCS1/UTF8/EBCDIC/UCS2BE/UTF16BE/UCS2LE/UTF16LE/UCS4BE/UTF32BE/UCS4LE/UTF32LE/LOCAL - Character set [SYSTEM]
NONE - No character set defined
SYSTEM - SYSTEM (environment specific (on mainframe EBCDIC else ASCII))
ASCII - ASCII (mainly used in the for open system)
UCS1 - UCS-1 (for text formatting identical to ASCII < 64k)
UTF8 - UTF-8 (for text formatting identical to ASCII < 2M)
EBCDIC - EBCDIC (mainly used on IBM mainframe)
UCS2BE - UCS-2 Big Endian (multibyte character set < 64k)
UTF16BE - UTF-16 Big Endian (multibyte character set < 2M)
UCS2LE - UCS-2 Little Endian (multibyte character set < 64k)
UTF16LE - UTF-16 Little Endian (multibyte character set < 2M)
UCS4BE - UCS-4 Big Endian (multibyte character set < 64k)
UTF32BE - UTF-32 Big Endian (multibyte character set < 2M)
UCS4LE - UCS-4 Little Endian (multibyte character set < 64k)
UTF32LE - UTF-32 Little Endian (multibyte character set < 2M)
LOCAL - LOCAL (platform specific (on mainframe EBCDIC else ASCII))
NUMBER: SEPARATOR=SYSTEM/PERIOD/COMMA/APOSTROPHE - Floating point separator [AUTO]
SYSTEM - Use locale dependent separator
PERIOD - Use period (.) as separator
COMMA - Use comma (,) as separator
APOSTROPHE - Use apostrophe (') as separator
NUMBER: GROUPSEPARATOR/MARKER=num/NON/OFF/SYSTEM/PERIOD/COMMA/SPACE/APOSTROPHE - Decimal marker [AUTO]
NON - Decimal marker are not set
OFF - Decimal marker are not allowed
SYSTEM - Use locale dependent separator
PERIOD - Use period (.) as separator
COMMA - Use comma (,) as separator
SPACE - Use space ( ) as separator
APOSTROPHE - Use apostrophe (') as separator
STRING: VALUE='str' - Default value (period) used, if string format is empty [ERROR]
SWITCH: ALLOWTRUNC - Allow truncated values [FALSE]