You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/03/11 09:51:20 UTC

[GitHub] [dubbo] CrazyHZM commented on a change in pull request #9692: fix bigDecimal scientific notation

CrazyHZM commented on a change in pull request #9692:
URL: https://github.com/apache/dubbo/pull/9692#discussion_r824552783



##########
File path: dubbo-common/src/main/java/org/apache/dubbo/common/utils/CompatibleTypeUtils.java
##########
@@ -171,7 +171,7 @@ public static Object compatibleTypeConvert(Object value, Class<?> type) {
                 return BigInteger.valueOf(number.longValue());
             }
             if (type == BigDecimal.class) {
-                return BigDecimal.valueOf(number.doubleValue());
+                return new BigDecimal(number.toString());

Review comment:
       Please add unit test.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org