Instantly share code, notes, and snippets.

View double.java
// 保留小数点后2位
Double d = 1.23456;
BigDecimal b = new BigDecimal(d);
// BigDecimal.ROUND_HALF_EVEN 银行家舍入法
d = b.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
View cloudSettings
{"lastUpload":"2018-06-25T16:07:35.457Z","extensionVersion":"v2.9.2"}
View cloudSettings
{"lastUpload":"2019-01-10T14:02:39.333Z","extensionVersion":"v3.2.4"}
View cloudSettings
{"lastUpload":"2018-05-17T14:29:41.954Z","extensionVersion":"v2.9.2"}
View cloudSettings
{"lastUpload":"2018-05-16T15:49:32.545Z","extensionVersion":"v2.9.2"}
View cloudSettings
{"lastUpload":"2018-05-16T15:48:12.289Z","extensionVersion":"v2.9.2"}
View cloudSettings
{"lastUpload":"2018-05-16T15:47:18.905Z","extensionVersion":"v2.9.2"}