11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Caché</strong> <strong>ObjectScript</strong> Functions- “)”- Leading or trailing spaces- The DecimalSeparator specified by the current locale (if format doesn't include “.”)- The NumericGroupSeparator specified by the current locale (if format doesn't include“.”)- The PlusSign property specified by the current locale (if format doesn't include “.”)- The MinusSign property specified by the current locale (if format doesn't include“.”)- “.” (if format includes “.”)- “,” (if format includes “.”)- “+” (if format includes “.”)- “-” (if format includes “ .”)ExamplesThese examples illustrate how different formats affect the behavior of $INUMBER. All ofthese examples assume the current locale is the default locale.In the following example, $INUMBER accepts a leading minus sign because of the “L”format code and returns -123456789.12345678:WRITE $INUMBER("-123,4,56,789.1234,5678","L")In the following example, $INUMBER generates an error becausethe sign is leading but the “T” format code specifies that trailing signs must be used:WRITE $INUMBER("-123,4,56,789.1234,5678","T")In the following example, the first $INUMBER succeeds and returns a negative number.The second $INUMBER generates an error because fnumber includesa sign but the “P” format code specifies that negative numbers must be enclosed in parenthesesrather than signed:WRITE !,$INUMBER("(123,4,56,789.1234,5678)","P")WRITE !,$INUMBER("-123,4,56,789.1234,5678","P")In the following example, $INUMBER generates an error because asign is present but the “-” format code specifies that numbers must be unsigned:WRITE $INUMBER("-123,4,56,789.1234,5678","-")228 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!