Remove unnecessary conversion

This commit is contained in:
Dima-1 2020-07-02 10:26:14 +03:00
parent d6143e100e
commit 6ceb385050
2 changed files with 2 additions and 2 deletions

View file

@ -88,7 +88,7 @@ public class VehicleParametersBottomSheet extends BasePreferenceBottomSheet {
currentValue = 0.0f; currentValue = 0.0f;
} }
selectedItem = preference.getEntryFromValue(preference.getValue()); selectedItem = preference.getEntryFromValue(preference.getValue());
String currentValueStr = currentValue == 0.0f ? "" : String.valueOf(df.format(currentValue + 0.01f)); String currentValueStr = currentValue == 0.0f ? "" : df.format(currentValue + 0.01f);
text.setText(currentValueStr); text.setText(currentValueStr);
text.clearFocus(); text.clearFocus();
text.setOnTouchListener(new View.OnTouchListener() { text.setOnTouchListener(new View.OnTouchListener() {

View file

@ -90,7 +90,7 @@ public class SizePreference extends DialogPreference {
if (!persistedString.equals(defaultValue)) { if (!persistedString.equals(defaultValue)) {
try { try {
final DecimalFormat df = new DecimalFormat("#.####", new DecimalFormatSymbols(Locale.US)); final DecimalFormat df = new DecimalFormat("#.####", new DecimalFormatSymbols(Locale.US));
persistedString = String.valueOf(df.format(Float.parseFloat(persistedString) + 0.01f)); persistedString = df.format(Float.parseFloat(persistedString) + 0.01f);
summary = String.format(getContext().getString(R.string.ltr_or_rtl_combine_via_space), summary = String.format(getContext().getString(R.string.ltr_or_rtl_combine_via_space),
persistedString, getContext().getString(assets.getMetricShortRes())); persistedString, getContext().getString(assets.getMetricShortRes()));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {