Is there an easy way to read back if the language set uses a decimal comma or a decimal point?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
EDIT: Updating based on @Algar’s suggestion; you can directly use:
As it will always return an instance of
DecimalFormatSymbols.Docs:
NumberFormat,DecimalFormat,DecimalFormatSymbolsAccording to the DecimalFormat docs, apparently calling NumberFormat.getInstance() is safe, but may return a subclass other than DecimalFormat (the other option I see is ChoiceFormat). I believe for the majority of instances it should be a DecimalFormat, and then you can compare
decSeparatoragainst a,and.to see which format it is using.