I need a point as decimal separator in my output file. When using this pattern :
@DataField(pos = 12, precision = 1, pattern = "####.#") Double amount;
with for ex. input: 1491.84 the output is strangely (no decimal): 1491.
if I change my pattern with a comma instead of a point :
@DataField(pos = 12, precision = 1, pattern = "####,#") Double amount;
input: 1491.84 output: 1491,8 then it works but why not for the point separator ?
Please have a look at your Locale
.
There is a common difference between English locales (like en_UK
or en_US
) and some European localse (like German or French) in the use of .
and ,
for decimal separator and decimal point.
Perhaps setting your locale to an english variant would help?