mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 17:01:16 +00:00
ICU-13717 Refactoring UDAT_FRACTIONAL_SECOND_FIELD to use zeroPaddingNumber for consistency with all other number formatting call sites in smpdtfmt.cpp
X-SVN-Rev: 41433
This commit is contained in:
parent
c2412adb1e
commit
7d627ba160
1 changed files with 3 additions and 6 deletions
|
@ -1566,18 +1566,15 @@ SimpleDateFormat::subFormat(UnicodeString &appendTo,
|
|||
case UDAT_FRACTIONAL_SECOND_FIELD:
|
||||
// Fractional seconds left-justify
|
||||
{
|
||||
currentNumberFormat->setMinimumIntegerDigits((count > 3) ? 3 : count);
|
||||
currentNumberFormat->setMaximumIntegerDigits(maxIntCount);
|
||||
int32_t minDigits = (count > 3) ? 3 : count;
|
||||
if (count == 1) {
|
||||
value /= 100;
|
||||
} else if (count == 2) {
|
||||
value /= 10;
|
||||
}
|
||||
FieldPosition p(FieldPosition::DONT_CARE);
|
||||
currentNumberFormat->format(value, appendTo, p);
|
||||
zeroPaddingNumber(currentNumberFormat, appendTo, value, minDigits, maxIntCount);
|
||||
if (count > 3) {
|
||||
currentNumberFormat->setMinimumIntegerDigits(count - 3);
|
||||
currentNumberFormat->format((int32_t)0, appendTo, p);
|
||||
zeroPaddingNumber(currentNumberFormat, appendTo, 0, count - 3, maxIntCount);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue