Logo Search packages:      
Sourcecode: icu version File versions

void DecimalFormat::applyPattern ( const UnicodeString pattern,
UParseError parseError,
UErrorCode status 
) [virtual]

Apply the given pattern to this Format object. A pattern is a short-hand specification for the various formatting properties. These properties can also be changed individually through the various setter methods.

There is no limit to integer digits are set by this routine, since that is the typical end-user desire; use setMaximumInteger if you want to set a real value. For negative numbers, use a second pattern, separated by a semicolon

 .      Example "#,#00.0#" -> 1,234.56
 

This means a minimum of 2 integer digits, 1 fraction digit, and a maximum of 2 fraction digits.

 .      Example: "#,#00.0#;(#,#00.0#)" for negatives in parantheses.
 

In negative patterns, the minimum and maximum counts are ignored; these are presumed to be set in the positive pattern.

Parameters:
patternThe pattern to be applied.
parseErrorStruct to recieve information on position of error if an error is encountered
statusOutput param set to success/failure code on exit. If the pattern is invalid, this will be set to a failure result. ICU 2.0

Definition at line 3856 of file decimfmt.cpp.

References FALSE.

Referenced by applyLocalizedPattern(), applyPattern(), setCurrency(), NumberFormatRegressionTest::Test4145457(), NumberFormatRegressionTest::Test4147295(), NumberFormatRegressionTest::Test4179818(), NumberFormatRegressionTest::Test4212072(), IntlTestDecimalFormatAPI::testAPI(), NumberFormatTest::TestPatterns2(), NumberFormatTest::TestSecondaryGrouping(), and unum_applyPattern().

{
    applyPattern(pattern, FALSE, parseError, status);
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index