Skip to main content

Null Format Provides Maximum Flexibility

Null Format Provides Maximum Flexibility

You can specify format as a null string. This is called a null format. When a null format is specified, $INUMBER accepts a fnumber value with any one of the following sign conventions:

  • No sign or parentheses.

  • Either a leading or trailing MinusSign, but not both.

  • Either a leading or trailing PlusSign, but not both.

  • Leading and trailing parentheses.

When a null format is specified, fnumber may optionally have NumericGroupSeparator symbols appear anywhere to the left or right of the DecimalSeparator, if any. However, each NumericGroupSeparator must have at least one digit to its immediate left and one to its immediate right. Sign rules are flexible, and leading and trailing blanks and zeros are ignored. Thus, the following two commands:

   WRITE !,$INUMBER("+1,23,456,7.8,9,100","")
   WRITE !,$INUMBER("0012,3456,7.891+","")

are both valid and return the same number, formatted according to the default locale. However,

   WRITE $INUMBER("1,23,,345,7.,8,9,","")

is invalid because of the adjacent commas, the adjacent period and comma, and the trailing comma. It generates an <ILLEGAL VALUE> error.

FeedbackOpens in a new tab