Unit conversion amount, Yuan retrocession

Docking often use payment platform

    Private String convertAmount (String trxamt) { 
        the BigDecimal Fee = new new the BigDecimal (trxamt);
         //   rounded to 2 decimal precision 
        Fee = fee.setScale (2 , BigDecimal.ROUND_HALF_UP);
         //   convert unit: min 
        fee = fee.multiply ( new new the BigDecimal (100 ));
         //   rounding the fractional part of the filter 
        Fee fee.setScale = (0 , RoundingMode.DOWN); 
        String AMOUNT = String.valueOf (Fee);
         return AMOUNT; 
    }

 

Guess you like

Origin www.cnblogs.com/shiblog/p/12101593.html