Java Math BigDecimal.movePointRight() 方法 Java Math BigDecimal.movePointLeft() 方法 Java Math BigDecimal.multiply() 方法 Java Math BigDecimal.movePointRight() 方法 package com.codingdict; import java.math.*; public class BigDecimalDemo { public static void main(String[] args) { // create 4 BigDecimal objects BigDecimal bg1, bg2, bg3, bg4; bg1 = new BigDecimal("123.23"); bg2 = new BigDecimal("12323"); bg3 = bg1.movePointRight(3); // 3 places right bg4 = bg2.movePointRight(-2);// 2 places left String str1 = "After moving the Decimal point " + bg1 + " is " + bg3; String str2 = "After moving the Decimal point " + bg2 + " is " + bg4; // print bg3, bg4 values System.out.println( str1 ); System.out.println( str2 ); } } Java Math BigDecimal.movePointLeft() 方法 Java Math BigDecimal.multiply() 方法