Changeset 15843 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java
r15842 r15843 4 4 import java.text.DecimalFormat; 5 5 import java.util.Arrays; 6 import java.util.Locale; 6 7 import java.util.Objects; 7 8 import java.util.Optional; … … 148 149 // #17109, support values like 0.5 or 1.5 - level values are multiplied by 2 when parsing, values are divided by 2 for formatting 149 150 .setValueExtractor(s -> (int) (Double.parseDouble(s) * 2.)) 150 .setValueFormatter(v -> DecimalFormat.getInstance().format(v / 2.)), 151 .setValueFormatter(v -> DecimalFormat.getInstance(Locale.ROOT).format(v / 2.)), 151 152 new AutoFilterRule("layer", 16) 152 153 .setDefaultValueSupplier(AutoFilterRule::defaultLayer), -
trunk/test/unit/org/openstreetmap/josm/gui/autofilter/AutoFilterRuleTest.java
r15842 r15843 6 6 7 7 import java.util.NoSuchElementException; 8 import java.util.stream.Collectors; 9 import java.util.stream.IntStream; 8 10 9 11 import org.junit.Rule; … … 42 44 assertTagValuesForPrimitive(level, "way level=10;12-13", 20, 24, 25, 26); 43 45 assertTagValuesForPrimitive(level, "way level=0;0.5;1;1.5;2;2.5;3", 0, 1, 2, 3, 4, 5, 6); 46 assertEquals("0 0.5 1 1.5 2 2.5 3", 47 IntStream.of(0, 1, 2, 3, 4, 5, 6).mapToObj(level::formatValue).collect(Collectors.joining(" "))); 44 48 } 45 49
Note:
See TracChangeset
for help on using the changeset viewer.