入参是小数的String,返回小数乘以100的String

String money = request.getParameter("orderAmt");

BigDecimal moneyDecimal = new BigDecimal(money);

String orderAmt = moneyDecimal.multiply(new BigDecimal("100")).stripTrailingZeros().toPlainString();

posted @ 2017-12-02 16:27  虚极静笃  Views(1739)  Comments(0Edit  收藏  举报