| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | BigDecimal proPrice =new BigDecimal("22.5"); |
| | | CurrencyUnit cny = CurrencyUnit.of("CNY"); |
| | | Money money = Money.of(cny, proPrice).dividedBy(BigDecimal.valueOf(0.95), RoundingMode.HALF_UP); |
| | | BigDecimal amount = money.getAmount(); |
| | | System.out.println(amount); |
| | | |
| | | System.out.println(Money.of(cny,proPrice).multipliedBy((long) 0.3)); |
| | | |
| | | System.out.println(proPrice.multiply(BigDecimal.valueOf(0.3))); |
| | | |
| | | BigDecimal ordPrice =new BigDecimal("13.05"); |
| | | BigDecimal multiply = ordPrice.multiply((new BigDecimal("6.5").divide(BigDecimal.valueOf(10)))); |
| | | System.out.println(multiply); |
| | | } |
| | | |
| | | |