常见单位转换,格式转换

  • 时间格式

  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

  aliPaymentReturnResponse.setNotify_time(sdf.parse(notifyTime));

  • 元-分之间的转换

  private static final BigDecimal HUNDRED_VALUE = new BigDecimal(100);

  BigDecimal totalFee = aliPaymentNotifyResponse.getTotal_fee();
  if (totalFee != null) {
  totalFee = totalFee.multiply(HUNDRED_VALUE);
  }

  paymentCallBackResponse.setTotalAmount(totalFee.intValue());

 

posted @ 2016-06-10 17:40  沐沉浮  阅读(114)  评论(0)    收藏  举报