简体   繁体   中英

Change java locale settings

Is it possible somehow change java locale settings like currency symbol or decimal separator. I mean not from java program, but using java configuration files or environment variables?

Not sure if that can be done, but why do you want to change them anyways? That's what locale is all about. I believe you need to just figure out a correct locale to work with.

If you need a decimal to be written as a comma ( , ) use the Locale.GERMAN instead of going and chainging the decimal separator of Locale.CHINESE .

Set the user.language and user.country java system properties.

For example, to use the German locale, start java with -Duser.language=de -Duser.country=DE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM