year.of.birth={0} was born on {1}
If I pass 2000 or 2008 to {1} the value gets parsed as 2,000 or 2,008.
I don't want the commas as part of my translated string. How should I avoid this?
The easy way is to pass them as Strings:
msg.format("year.of.birth", name, String.valueOf(2008));
An alternative is to specify the number format in the message resource (but I would only do that if the format can vary between locales):
year.of.birth={0} was born in {1,number,####}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With