2.2.1.6 FormatInfo

The FormatInfo complex type specifies the format for a field in a Source (section 3.1.1). The format is used by the protocol server to verify the value of the field sent by the protocol client and also to convert the value of field to its format before returning the value to the protocol client.

The FormatInfo complex type is an input as well as output used by some protocol operations.

The following ABNF references types specified by section 2.2 and applies to the FormatInfo, unless extended or overridden by an operation specification.

 FormatInfo = json-object
 Currency = json-quotation-mark "Currency" json-quotation-mark json-name-separator json-string
 Format = json-quotation-mark "Format" json-quotation-mark json-name-separator json-string
 Precision = json-quotation-mark "Precision" json-quotation-mark json-name-separator json-int

FormatInfo MUST contain three json-member instances, and each instance MUST be different. Each instance MUST be one of the following: Currency, Format, and Precision.

Currency: A json-string (section 2.2) that specifies the currency symbol for the value of a field of a Source (section 3.1.1) in the database application. MUST be set to json-null (section 2.2) when the Format of the value of the field is not "currency".

Format: A json-string (section 2.2) that specifies the format for the value of a field of a Source (section 3.1.1) in the database application. MUST either be json-null (section 2.2) or MUST have one of the following values.

Value

Meaning

"general date"

The field is formatted as general date. For example, 01/02/2011 01:20:30 PM.

"long date"

The field is formatted as long date. For example, Monday, Jan 01, 2011.

"short date"

The field is formatted as short date. For example, 01/01/11.

"long time"

The field is formatted as long time. For example, 5:34:45 PM.

"medium time"

The field is formatted as medium time. For example, 5:34.

"short time"

The field is formatted as short time. For example, 17.

"general number"

The number format is general. For example, 123,456.

"standard"

The number format applied is standard. For example, 1234,567.89.

"fixed"

The number format applied is fixed. For example, 1234.56.

"scientific"

The number format applied is scientific. For example, 123E+03.

"percent"

The number format applied is percentage. For example, 12.3%.

"currency"

The number format applied is currency. For example, $12.34.

Precision: A json-int (section 2.2) that specifies the maximum number of digits present after the decimal point in the value of a field of a Source (section 3.1.1) in the database application. MUST be a number between 0 and 15 and MUST only be present when Format is one of the following:

  • "general number"

  • "standard"

  • "fixed"

  • "scientific"

  • "percent"

  • "currency"