3 ms·
> Junior dev > Monolithic java codebase > "we already wrote something similar" Sometimes it's not even them who wrote something. I was working on a Java cod
by Ologn 11y ago
> Junior dev
> Monolithic java codebase
> "we already wrote something similar"
Sometimes it's not even them who wrote something. I was working on a Java codebase where decimal numbers always had the separator be a period (e.g. 1.2).
In (most of) continental Europe, the character they use to separate the numbers in a decimal is a comma (e.g. 1,2). So I coded something up to do a location-specific separator.
Woops! Actually java.text.DecimalFormatSymbols().getDecimalSeparator() will do that, and has been a Java core API since Java 1.1.