我一直在尝试将秒值(在BigDecimal变量中)转换为editText之类的字符串,例如“ 1小时22分33秒”或类似的内容。
我已经试过了:
String sequenceCaptureTime = "";
BigDecimal roundThreeCalc = new BigDecimal("0");
BigDecimal hours = new BigDecimal("0");
BigDecimal myremainder = new BigDecimal("0");
BigDecimal minutes = new BigDecimal("0");
BigDecimal seconds = new BigDecimal("0");
BigDecimal var3600 = new BigDecimal("3600");
BigDecimal var60 = new BigDecimal("60");
(我有一个roundThreeCalc,它是以秒为单位的值,所以我尝试在这里进行转换。)
hours = (roundThreeCalc.divide(var3600));
myremainder = (roundThreeCalc.remainder(var3600));
minutes = (myremainder.divide(var60));
seconds = (myremainder.remainder(var60));
sequenceCaptureTime = hours.toString() + minutes.toString() + seconds.toString();
然后,将editText设置为sequnceCaptureTime String。但这没有用。每次都强制关闭该应用程序。我完全不在这里,我们将不胜感激。编码愉快!