From 8add68bddb8d8d14d2d59400a0ef1b7e4b479a4d Mon Sep 17 00:00:00 2001 From: serso Date: Mon, 2 May 2016 17:20:50 +0200 Subject: [PATCH] Make maxPrecision=15 --- .../calculator/preferences/NumberFormatPreference.java | 5 ++--- jscl/src/main/java/org/solovyev/common/NumberFormatter.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/preferences/NumberFormatPreference.java b/app/src/main/java/org/solovyev/android/calculator/preferences/NumberFormatPreference.java index 8a36d481..f921f8a6 100644 --- a/app/src/main/java/org/solovyev/android/calculator/preferences/NumberFormatPreference.java +++ b/app/src/main/java/org/solovyev/android/calculator/preferences/NumberFormatPreference.java @@ -63,9 +63,8 @@ public class NumberFormatPreference extends DialogPreference { ButterKnife.bind(this, view); final SharedPreferences preferences = getSharedPreferences(); - final int maxPrecision = precisionSeekBar.getMaxTick(); - precisionSeekBar.setMax(maxPrecision); - precisionSeekBar.setCurrentTick(Math.max(0, Math.min(maxPrecision, Output.precision.getPreference(preferences)))); + precisionSeekBar.setMax(NumberFormatter.MAX_PRECISION); + precisionSeekBar.setCurrentTick(Math.max(0, Math.min(NumberFormatter.MAX_PRECISION, Output.precision.getPreference(preferences)))); notationAdapter = makeNotationAdapter(); notationSpinner.setAdapter(notationAdapter); notationSpinner.setSelection(indexOf(notationAdapter, Output.notation.getPreference(preferences))); diff --git a/jscl/src/main/java/org/solovyev/common/NumberFormatter.java b/jscl/src/main/java/org/solovyev/common/NumberFormatter.java index 8c824e98..e5fa934a 100644 --- a/jscl/src/main/java/org/solovyev/common/NumberFormatter.java +++ b/jscl/src/main/java/org/solovyev/common/NumberFormatter.java @@ -18,7 +18,7 @@ public class NumberFormatter { public static final char NO_GROUPING = 0; public static final int NO_ROUNDING = -1; public static final int DEFAULT_MAGNITUDE = 5; - public static final int MAX_PRECISION = 16; + public static final int MAX_PRECISION = 15; private final Real.NumberFormat numberFormat = new Real.NumberFormat(); private final Real real = new Real();