就例如:
TextView textView1 = (TextView) findViewById(R.id.TextView1); double test = 99999999999.99; textView1.setText(String.valueOf(test));
会显示成9.999999999E10
解决办法
修改成:
double test = 99999999999.99; TextView textView2 = (TextView) findViewById(R.id.TextView2); textView2.setText(String.format(Locale.ENGLISH, "%.3f", test));
会显示99999999999.990
原文地址:https://www.cnblogs.com/momoshengxiao/p/9501461.html
时间: 2024-10-07 21:09:41