parseNumberWithFmtAndLcid

parseNumberWithFmtAndLcid(source:    String;
                          fmt:       NumberFormat;
                          lcid:      Integer;
                          errOffset: Integer output): Integer updating;

The parseNumberWithFmtAndLcid method of the Decimal primitive type parses the string specified in the source parameter using the specified format and locale, to ensure that it matches the format specified in the fmt parameter for sign character sequence, sign position, thousands separator, decimal point sequence, and character set.

If the value of the fmt parameter is null, the settings for the locale specified in the lcid parameter are used. If the value of the lcid parameter is zero (0), the settings of the current locale are used.

If the value of the source parameter matches the format rules, the method returns zero (0) and sets the receiver to the parsed value. If it does not match the format rules, it returns a JADE error code (parse errors are in the range 1800 through 1869), indicates the first offending character returning its zero-based offset using the output errOffset parameter, and sets the receiver to the invalid value.

The negative sign sequence is optional but if it is included in the source, it must be correctly positioned. A space included in the sign sequence is optional. There is no positive sign sequence.

Thousands separator character sequences are optional but if they are included in the source, each one must have at least one digit preceding and following it, and must occur before the decimal point (if any).

If native digits are allowed, if the first digit found in the source is a native digit, all subsequent digits must also be native. Similarly, if the first digit found is ASCII, all subsequent digits must also be ASCII.

The decimal descriptor of the receiver adds restrictions to the permitted value in the source parameter string; for example, a descriptor of [8,2] allows the value to have up to eight significant digits, with at most two significant digits following the decimal point and six preceding it. Leading zeros before the decimal point and trailing zeros after the decimal point are ignored.

The following values are valid.

All significant digits in the source parameter string must be able to be stored in the receiver so that they are all shown if the receiver is converted back to a string.

If you do not define the EnhancedLocaleSupport parameter in the [JadeEnvironment] section of the JADE initialization file on the database node or you set it to false, inconsistent results could be returned to the application server when running in JADE thin client mode and there are locale overrides, as all overrides on the application server are suppressed if enhanced locale support is not enabled. Formatting of locale data is done on the application server, based on the locale of the corresponding presentation client.