Skip to content
Snippets Groups Projects
Unverified Commit d0231c65 authored by Lukas Lechner's avatar Lukas Lechner Committed by GitHub
Browse files

7 day incidence decimal place issue (EXPOSUREAPP-4750) #2212

parent f82fbf7b
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ fun formatStatisticalValue(
return when (decimals) {
in Int.MIN_VALUE..0 -> DecimalFormat("#,###", DecimalFormatSymbols(locale))
1 -> DecimalFormat("#,###.#", DecimalFormatSymbols(locale))
1 -> DecimalFormat("#,###.0", DecimalFormatSymbols(locale))
else -> DecimalFormat("#,###.##", DecimalFormatSymbols(locale))
}.format(value)
}
......@@ -55,6 +55,8 @@ internal class StatisticsNumberValueFormatterTest {
Arguments.of(12.3456, 1, Locale.GERMANY, "12,3"),
Arguments.of(12.3456, 2, Locale.GERMANY, "12,35"),
Arguments.of(1.0036, 1, Locale.GERMANY, "1,0"),
Arguments.of(12.3456, 1, Locale.UK, "12.3"),
Arguments.of(12.6543, -1, Locale.GERMANY, "13"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment