Use Real all the time

This commit is contained in:
serso
2016-04-09 21:12:15 +02:00
parent 1090ba856f
commit 29d4d77831
17 changed files with 994 additions and 1073 deletions

View File

@@ -21,6 +21,7 @@ import android.widget.*;
import butterknife.Bind;
import butterknife.ButterKnife;
import jscl.JsclMathEngine;
import jscl.NumeralBase;
import midpcalc.Real;
import org.solovyev.android.calculator.*;
@@ -310,12 +311,13 @@ public class ConverterFragment extends BaseDialogFragment
if (!TextUtils.isEmpty(groupingSeparator)) {
value = value.replace(groupingSeparator, "");
}
return Double.longBitsToDouble(new Real(value).toDoubleBits());
final long bits = new Real(value).toDoubleBits();
return Double.longBitsToDouble(bits);
}
@Nonnull
private String formatDouble(double toValue) {
return JsclMathEngine.getInstance().formatDec(toValue);
return JsclMathEngine.getInstance().format(toValue, NumeralBase.dec);
}
@Override