This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SwissDecimalFormatTest { | |
@Test | |
void decimalFormat() { | |
Locale switzerland = new Locale("de", "CH"); | |
DecimalFormat format = (DecimalFormat) NumberFormat.getInstance(switzerland); | |
format.applyPattern("#,##0.00"); | |
String formatted = format.format(new BigDecimal("1234567.8")); | |
assertEquals("1'234'567.80", formatted); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PortableDecimalFormatTest { | |
@Test | |
void decimalFormat() { | |
Locale switzerland = new Locale("de", "CH"); | |
DecimalFormat format = (DecimalFormat) NumberFormat.getInstance(switzerland); | |
format.applyPattern("#,##0.00"); | |
DecimalFormatSymbols decimalFormatSymbols = format.getDecimalFormatSymbols(); | |
decimalFormatSymbols.setGroupingSeparator('\''); | |
// important because #getDecimalFormatSymbols() returns a clone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH calendar(date_value) AS ( | |
SELECT TIMESTAMP '1582-09-30 00:00:00' | |
FROM dual | |
UNION ALL | |
SELECT date_value + 1 | |
FROM calendar | |
WHERE date_value <= TIMESTAMP '1582-10-16 00:00:00' | |
) | |
SELECT date_value | |
FROM calendar; |
OlderNewer