public class StringToBigDecimalDemo {
public static void main(String[] args) {
String currency="13.14";
BigDecimal bigDecimalCurrency=new BigDecimal(currency);
System.out.println("String to bigDecimalCurrency: "+bigDecimalCurrency);
}
}
最后的输出结果:13.14。