ICU-2334 add UNUM_SIGNIFICANT_DIGITS_USED

X-SVN-Rev: 14942
This commit is contained in:
Alan Liu 2004-04-12 23:38:01 +00:00
parent e1b4d36b9f
commit f667e25fdf
2 changed files with 13 additions and 3 deletions

View File

@ -494,6 +494,9 @@ typedef enum UNumberFormatAttribute {
UNUM_PADDING_POSITION,
/** Secondary grouping size */
UNUM_SECONDARY_GROUPING_SIZE,
/** Use significant digits
* @draft ICU 3.0 */
UNUM_SIGNIFICANT_DIGITS_USED,
/** Minimum significant digits
* @draft ICU 3.0 */
UNUM_MIN_SIGNIFICANT_DIGITS,

View File

@ -363,6 +363,9 @@ unum_getAttribute(const UNumberFormat* fmt,
// TBD: what should this return?
return df->getMinimumFractionDigits();
case UNUM_SIGNIFICANT_DIGITS_USED:
return df->areSignificantDigitsUsed();
case UNUM_MAX_SIGNIFICANT_DIGITS:
return df->getMaximumSignificantDigits();
@ -407,15 +410,15 @@ unum_setAttribute( UNumberFormat* fmt,
DecimalFormat* df = (DecimalFormat*) fmt;
switch(attr) {
case UNUM_PARSE_INT_ONLY:
df->setParseIntegerOnly((UBool)newValue);
df->setParseIntegerOnly(newValue!=0);
break;
case UNUM_GROUPING_USED:
df->setGroupingUsed((UBool)newValue);
df->setGroupingUsed(newValue!=0);
break;
case UNUM_DECIMAL_ALWAYS_SHOWN:
df->setDecimalSeparatorAlwaysShown((UBool)newValue);
df->setDecimalSeparatorAlwaysShown(newValue!=0);
break;
case UNUM_MAX_INTEGER_DIGITS:
@ -444,6 +447,10 @@ unum_setAttribute( UNumberFormat* fmt,
df->setMaximumFractionDigits(newValue);
break;
case UNUM_SIGNIFICANT_DIGITS_USED:
df->setSignificantDigitsUsed(newValue!=0);
break;
case UNUM_MAX_SIGNIFICANT_DIGITS:
df->setMaximumSignificantDigits(newValue);
break;