kotlin sharedpreferences with double code example
Example: storing a double in sharedpreferences
Editor putDouble(final Editor edit, final String key, final double value) {
return edit.putLong(key, Double.doubleToRawLongBits(value));
}
double getDouble(final SharedPreferences prefs, final String key, final double defaultValue) {
return Double.longBitsToDouble(prefs.getLong(key, Double.doubleToLongBits(defaultValue)));
}