private String GetText(float res) {
if (!PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("DECIMAL_USE", true)) {
DecimalFormat decimalFormat = new DecimalFormat("###############");
return decimalFormat.format(res);
} else {
switch (Integer.parseInt(PreferenceManager.getDefaultSharedPreferences(getContext()).getString("ROUNDIND_INFO", "0"))) {
case 0:
return String.valueOf(res);
case 1:
DecimalFormat single = new DecimalFormat("########.#");
return single.format(res);
case 2:
DecimalFormat Double = new DecimalFormat("########.##");
return Double.format(res);
case 3:
DecimalFormat triple = new DecimalFormat("########.###");
return triple.format(res);
default:
return String.valueOf(res);
}
}
}
ViewMatrixFragment.java 文件源码
java
阅读 113
收藏 0
点赞 0
评论 0
项目:Matrix-Calculator-for-Android
作者:
评论列表
文章目录