We're updating the issue view to help you get more done. 

Grouping separators in pattern string are allowed in places they weren't before

Description

ICU 58 threw an exception if the pattern string contained commas without number placeholders separating them. My new code admits such patterns and treats them as if grouping were disabled.

Code:

1 2 3 4 5 6 7 try { DecimalFormat df = new DecimalFormat("$0,,M"); System.out.println(df); System.out.println(df.format(123456789)); } catch (IllegalArgumentException e) { System.out.println(e); }

ICU 58 output:

java.lang.IllegalArgumentException: Malformed pattern in pattern "`$0,,M`"

ICU 59 output (emphasis mine):

com.ibm.icu.text.DecimalFormat@10753 { symbols@1073a '''groupingSize:0''' maximumFractionDigits:0 minimumFractionDigits:0 minimumIntegerDigits:1 positivePrefixPattern:$ positiveSuffixPattern:M '''secondaryGroupingSize:0''' }

 

`$123456789M`

'''My opinion:''' This is not an important regression; users who were depending on the old behavior should update their code.

GoogleIssue:37158136

Environment

Status

Assignee

Shane Carr

Reporter

Shane Carr

tracCreated

Apr 07, 2017, 11:08 PM

tracOwner

shane

tracProject

all

tracReporter

shane

tracResolution

fixed

tracReviewer

andy

tracStatus

closed

Components

Fix versions

Priority

assess