{"id":795,"date":"2024-04-15T12:40:39","date_gmt":"2024-04-15T03:40:39","guid":{"rendered":"http:\/\/inwelly.com\/?p=795"},"modified":"2024-04-22T05:01:39","modified_gmt":"2024-04-21T20:01:39","slug":"java-bigdecimal-%ed%98%95%eb%b3%80%ed%99%98","status":"publish","type":"post","link":"https:\/\/inwelly.com\/?p=795","title":{"rendered":"JAVA BigDecimal \ud615\ubcc0\ud658"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>import java.math.BigDecimal;\n \n \npublic class CastingTest {\n \n    public static void main(String&#91;] args) {\n         \n        BigDecimal bigDecimal = new BigDecimal(\"5\");\n \n        double doubleValue = bigDecimal.doubleValue();\n         \n        float floatValue = bigDecimal.floatValue();\n         \n        int intValue = bigDecimal.intValue();\n         \n        short shortValue = bigDecimal.shortValue();\n         \n        long longValue = bigDecimal.longValue();\n         \n        System.out.println(\"doubleValue: \"+doubleValue);\n        System.out.println(\"floatValue: \"+floatValue);\n        System.out.println(\"intValue: \"+intValue);\n        System.out.println(\"shortValue: \"+shortValue);\n        System.out.println(\"longValue: \"+longValue);\n \n    }\n \n}\n\n# BigDecimal -> int -> String\nBigDecimal ABC = new BigDecimal(request.getParameter(\"ABC\"));\t\t\t\t\n\nint intABC = ABC.intValue();\nString StringABC = String.valueOf(intABC);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1280,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[],"class_list":["post-795","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=795"}],"version-history":[{"count":1,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/795\/revisions"}],"predecessor-version":[{"id":796,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/795\/revisions\/796"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/media\/1280"}],"wp:attachment":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}