Use device locale's separator by default

This commit is contained in:
Naveen 2022-06-10 09:49:54 +05:30
parent 0873a0fec4
commit f229eac421
2 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,6 @@ class Config(context: Context) : BaseConfig(context) {
}
var useCommaAsDecimalMark: Boolean
get() = prefs.getBoolean(USE_COMMA_AS_DECIMAL_MARK, false)
get() = prefs.getBoolean(USE_COMMA_AS_DECIMAL_MARK, getDecimalSeparator() == COMMA)
set(useCommaAsDecimalMark) = prefs.edit().putBoolean(USE_COMMA_AS_DECIMAL_MARK, useCommaAsDecimalMark).apply()
}

View File

@ -29,3 +29,7 @@ class NumberFormatHelper(
return str.replace(groupingSeparator, "").replace(decimalSeparator, DOT)
}
}
fun getDecimalSeparator(): String {
return DecimalFormatSymbols.getInstance().decimalSeparator.toString()
}