mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-18 11:14:22 +00:00
ICU-3790 fix parsing; '-' does not show up in digitlist
X-SVN-Rev: 15627
This commit is contained in:
parent
ed683c99db
commit
137505408f
1 changed files with 1 additions and 6 deletions
|
@ -1460,20 +1460,15 @@ public class DecimalFormat extends NumberFormat {
|
|||
// hack quick long
|
||||
if (digitList.decimalAt < 12) { // quick check for long
|
||||
long l = 0;
|
||||
boolean negate = false;
|
||||
if (digitList.count > 0) {
|
||||
int nx = 0;
|
||||
if (digitList.digits[0] == '-') {
|
||||
negate = true;
|
||||
nx = 1;
|
||||
}
|
||||
while (nx < digitList.count) {
|
||||
l = l * 10 + (char)digitList.digits[nx++] - '0';
|
||||
}
|
||||
while (nx++ < digitList.decimalAt) {
|
||||
l *= 10;
|
||||
}
|
||||
if (negate) {
|
||||
if (!status[STATUS_POSITIVE]) {
|
||||
l = -l;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue