{"id":2203,"date":"2017-02-03T12:04:45","date_gmt":"2017-02-03T09:04:45","guid":{"rendered":"http:\/\/www.fatihacar.com\/blog\/?p=2203"},"modified":"2017-04-10T23:47:02","modified_gmt":"2017-04-10T20:47:02","slug":"round-up-a-number-by-protecting-2-decimal-in-oracle","status":"publish","type":"post","link":"http:\/\/www.fatihacar.com\/blog\/round-up-a-number-by-protecting-2-decimal-in-oracle\/","title":{"rendered":"Round Up A Number By Protecting 2 Decimal in Oracle"},"content":{"rendered":"<p>I will show how to round up a number by protecting 2 decimal. When I use round or ceil function, I can not have correct result. I want to round a number upwards with calculate 2 decimal.<\/p>\n<p>I want result like below examples.<\/p>\n<p>1.2445 &gt; 1.25<br \/>\n1.21 &gt; 1.21<br \/>\n1.521 &gt; 1.53<br \/>\n1.1 &gt; 1.1<\/p>\n<p>You can use trunc function with add 0.009 to number.<\/p>\n<p><strong>Examples<\/strong><\/p>\n<blockquote><p>select trunc(1.224 + 0.009,2) from dual;<br \/>\n1.23<br \/>\nselect trunct(1.16 + 0.009,2) from dual;<br \/>\n1.16<br \/>\nselect trunct(1.521 + 0.009,2) from dual;<br \/>\n1.53<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I will show how to round up a number by protecting 2 decimal. When I use round or ceil function, I can not have correct result. I want to round a number upwards with calculate 2 decimal. I want result like below examples. 1.2445 &gt; 1.25 1.21 &gt; 1.21 1.521 &gt; 1.53 1.1 &gt; 1.1&#8230;<\/p>\n","protected":false},"author":37,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[32,103,91],"class_list":["post-2203","post","type-post","status-publish","format-standard","hentry","category-oracle-sql","tag-oracle-administration","tag-oracle-sql-query","tag-oracle-sql"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p39NFI-zx","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/2203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/comments?post=2203"}],"version-history":[{"count":4,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/2203\/revisions"}],"predecessor-version":[{"id":2349,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/2203\/revisions\/2349"}],"wp:attachment":[{"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/media?parent=2203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/categories?post=2203"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/tags?post=2203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}