Skip to content

Commit

Permalink
修复小米手机小数精度丢失问题
Browse files Browse the repository at this point in the history
  • Loading branch information
catchpig committed Mar 20, 2018
1 parent 02fcedc commit 50d9c40
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,9 @@ public static String formatCardNumber(String cardNumber) {
public static String format(Object obj, int scale, RoundingMode mode) {
if (obj == null) {
obj = 0;

} else if (obj instanceof String) {
if (validateNumber(obj.toString())) {
obj = new BigDecimal(obj.toString()).doubleValue();
obj = new BigDecimal(obj.toString());
} else {
obj = 0;
}
Expand Down

0 comments on commit 50d9c40

Please sign in to comment.