简体   繁体   中英

Change decimal separator on Android

I am running the following in my Android application:

LocaleData data = LocaleData.get(desiredLocale);

to get the decimal separator.

Currently the variable desiredLocale = 'es' and returns the decimal separator as "," How can I get to get the decimal separator "."?

您可以通过配置DecimalFormatSymbols来做到这一点:

DecimalFormatSymbols.getInstance().getDecimalSeparator('.');

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