mbeckerle commented on a change in pull request #191: Ensure locale does not
effect text numbers and date/times
URL: https://github.com/apache/incubator-daffodil/pull/191#discussion_r262100596
##########
File path:
daffodil-runtime1/src/test/scala/org/apache/daffodil/processors/input/TestICU.scala
##########
@@ -149,4 +151,32 @@ class TestICU {
//assertEquals(1234L, num)
//assertEquals(7, pp.getIndex)
}
+
+ // Shows that even if a decimal format pattern doesn't contain a decimal, the
+ // decimal format separator from the locale still has an effect and can cause
+ // locale specific behavior
+ @Test def test_local_side_effect = {
+
+ // Germany's locale has a decimal separator of ','
+ val dfs = new DecimalFormatSymbols(java.util.Locale.GERMANY)
+
+ // Set the grouping separator to be the same as the decimal separator from
+ // the locale. ICU never complains
+ dfs.setGroupingSeparator(',')
+
+ // Define a pattern that only has a grouping separator--no decimal
separator
+ val df = new DecimalFormat("###,###", dfs)
+
+ // We don't have a decimal character in the pattern, so one might expect
Review comment:
"decimal point character" ? In the pattern this is always a ".", so calling
it the decimal point seems ok.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services