When DataTextDisplay is set to true and DataTextFormat is set to minus one, this property is used to specify a standard Java number format pattern for data text values.
Syntax:
setDataTextFormatPattern(pattern);
pattern = getDataTextFormatPattern();
where:
Is a pattern string in the following format:
pattern:= subpattern{;subpattern} subpattern:= {prefix}integer{.fraction}{suffix} prefix:= '\\u0000'..'\\uFFFD' - specialCharacters suffix:= '\\u0000'..'\\uFFFD' - specialCharacters integer:= '#'* '0'* '0' fraction:= '0'* '#'*
"#.#" is the default value.
Notation | For... |
---|---|
X* | 0 or more instances of X. |
(X|Y) | Either X or Y. |
X..Y | Any character from X up to Y, inclusive. |
S - T | Characters in S, except those in T. |
The first subpattern is for positive numbers. The second (optional) subpattern is for negative numbers. In both cases, a comma (,) can occur inside the integer portion. Here are the special characters used in the parts of the subpattern, with notes on their usage.
Notation | For... |
---|---|
0 | A digit. |
# | A digit, zero shows as absent. |
. | A period (.) is a placeholder for decimal separator. |
, | A comma (,) is a placeholder for grouping separator. |
; | A semicolon (;) separates formats. |
- | A minus sign/dash (-) is the default negative prefix. |
% | Divide by 100 and show as percentage. |
x | Any other characters can be used in the prefix or suffix. |
' | A single quote (') is used to quote special characters in a prefix or suffix. |
If there is no explicit negative subpattern, a minus sign (-) is prefixed to the positive form (that is, "0.00" alone is equivalent to "0.00;-0.00"). Illegal formats, such as "#.#.#" or mixing '_' and '*' in the same format, will cause a ParseException. The ParseException string will show where the error occurred. The grouping separator is commonly used for thousands, but in some countries for ten-thousands. The interval is a constant number of digits between the grouping characters, such as 100,000,000 or 1,0000,0000. If you supply a pattern with multiple grouping characters, the interval between the last one and the end of the integer is the one that is used. So "#,##,###,####" == "######,####" == "##,####,####". This class only handles localized digits where the 10 digits are contiguous in Unicode, from 0 to 9.
Note:
See DataTextAngleDefault, DataTextRadiusDefault, DataTextDisplay, DataTextFormat, DataTextPosition.
WebFOCUS |