11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

In the following example, $INUMBER fails but does not generate an error due to the illegaluse of a sign, but instead returns as its value the string “ERR” specified as the erropt:WRITE $INUMBER("-123,4,56,789.1234,5678","-","ERR")The following example returns -23456789.123456789; $INUMBER accepts the specifiedfnumber as valid because the leading sign follows the formatting specified by “L” and thestrict spacing of commas every three digits to the left of the decimal place with no commasto its right follows the strict formatting specified by the “,” code:WRITE $INUMBER("-23,456,789.123456789","L,")NotesDifferences between $INUMBER and $FNUMBERMost format codes have similar meanings in the $INUMBER and $FNUMBER functions,but the exact behavior triggered by each code differs by function because of the nature of thevalidations and conversions being performed.In particular, the “-” and “+” format codes don't have quite the same meaning for $INUMBERas they do for $FNUMBER. With $FNUMBER, “-” and “+” are not mutually exclusive,and “-” only affects the MinusSign (by suppressing it), and “+” only affects the PlusSign (byinserting it). With $INUMBER, “-” and “+” are mutually exclusive. “-” means no sign ispermitted, and “+” means there must be a sign.In addition, $INUMBER supports the “L” format code, while $FNUMBER does not.Decimal Delimiter$INUMBER will use the value of the DecimalSeparator property of the current locale as thedelimiter between the whole part and fractional part of a number (unless the format code is“.”). The default value of DecimalSeparator is “.” and all documentation uses this delimiter.Numeric Group Delimiter$INUMBER will use the value of the NumericGroupSeparator property of the current locale(“,” by default) as the delimiter between groups of digits in the whole part of fnumber. Thesize of these groups is determined by the NumericGroupSize property of the current locale.When the “.” format code is specified, this delimiter is a “.” and appears every three digitsregardless of the current locale.See Also• $FNUMBER function$INUMBER<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 229

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!