You are viewing the documentation for Blueriq 16. Documentation for other versions is available in our documentation directory.

AQ_NumberPattern


Use this mask type to change the way a number value is displayed in Blueriq Encore documents.


Parameters

NameDescriptionTypeRequired
pattern

A number format pattern

At least one zero at the end of the decimal syntax is required.

stringtrue
prefixText string that will be displayed in front of the formatted number valuestringfalse
postfixText string that will be displayed behind of the formatted number valuestringfalse
zero-fractionString value that substitutes the fraction part when the fraction is zerostringfalse


Pattern

The pattern syntax: {options}format;negative-spec;positive-spec

  • options
    The option set is optional and must be surrounded with {} when used. It represents a key value mechanism separated by ',' signs.
    Examples include: a=b,q=e meaning a is set to b and q is set to e.
    Valid options are:
    • locale=nl-NL: This specifies a locale in the option set overriding the one of the NumberFormats' class.
  • format
    The format pattern which actually specified how the number should look like consists of a decimal part and an fractional part divided by a '.' when a fractional part is required.
    • decimal
      Decimal part specifies how grouping, minimum decimal and maximum decimal digits. For example a pattern: #,##0 specifies at least 1 decimal digit ( which is always the case ) and grouping every 3 decimal digits. With a maximum of 4 decimal digits. At least 1 zero at the end of the decimal syntax is required for the pattern to parse.
    • fractional
      The fractional part begins if there is a decimal separator '.'. If there is no decimal separator there is no fractional part. The fractional part specifies how many minimum fraction digits there are required and how many fraction digits at max are allowed. For example a syntax 0.00## will specify that at least two fractional should be displayed and at most four.
  • negative-spec
    Negative pattern has only 2 special characters: '#' and ';'. The '#' will dictate the actual number pattern specified earlier. For example: 0.0;(#) will specify that a negative number is prefixed with '(' and postfixed with ')' While ';' will end the pattern part and proceed to the positive specification
  • positive-spec
    The positive pattern has only 1 special character: '#'. The '#' will dictate the actual number pattern specified earlier. For example: 0.0;(#) will specify that a negative number is prefixed with '(' and postfixed with ')'


Supported attribute types

  • number

  • percentage

  • currency

  • integer


Examples

To displayasuse this pattern
500000,00500.000,-pattern: #,##0.00  zero-fraction: -
500000,00€ 500.000,00pattern: #,##0.00  prefix: €
1212,000 %pattern: #,##0.000  postfix: %
-180,12180pattern: #0;#
23+023,00pattern: {locale=NL-nl}000.00;-#;+#

Note that the comma and dot in the pattern are not taken literally; they are just stand-in symbols for the decimal separator and the grouping separator. The actual symbols used depend on the language (locale). For example, the number 1234567.89 with pattern #,##0.00 results in the following numbers, depending on the language used:

  • en-GB (English - United Kingdom): 1,234,567.89 (comma as grouping separator, dot as decimal separator)
  • nl-NL (Dutch): 1.234.567,89 (dot as grouping separator comma as decimal separator)
  • fr-FR (French): 1 234 567,89 (space as grouping separator, comma as decimal separator)

The locale can also be fixed in the pattern, so that the pattern is no longer locale-sensitive. In case you want to have a space as the grouping separator for the number 1234567.89 you should use the {locale=fr-FR}#,##0.00 as pattern, which will result in 1 234 567,89 no matter what language is used for the rest of the project.

When you place a currency sign in front of a number, don’t forget to add a space behind the currency sign. So, write '€ ' instead of '€' in the prefix.

Back to Top