{"id":71,"date":"2013-11-22T08:19:38","date_gmt":"2013-11-22T08:19:38","guid":{"rendered":"http:\/\/blog.goodwill.co.id\/?p=71"},"modified":"2013-11-22T08:26:58","modified_gmt":"2013-11-22T08:26:58","slug":"flexible-precision-in-numeric-display-type","status":"publish","type":"post","link":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/","title":{"rendered":"Flexible Precision In Numeric Display Type"},"content":{"rendered":"<p>Hi all,<\/p>\n<p>Today I would like to share my approach to provide\u00a0 flexible precision in numeric display type. As you know there are several numeric display types in Adempiere \/ Idempiere. You can find them in the list of Reference Type in Table &amp; Column window. You can see you can have either Number, Amount, Cost+Price, Quantity or Integer. While Integer is obviously for whole number, there is confusion to know the difference between the rest.<\/p>\n<p>The differences are easily tracked down in DisplayType class which you can find in <em>org.compiere.util<\/em>. It is the minimum number of digits allowed in the fraction portion of a number. So there you have:<\/p>\n<p>Integer\u00a0 : None<br \/>\nQuantity : None<br \/>\nAmount\u00a0\u00a0 : 2<br \/>\nCost+Price: 2<br \/>\nNumber\u00a0\u00a0 : 1<\/p>\n<p>As you can see Cost+Price is having the same number of digits as Amount. You can not tell the difference between the two. So let&#8217;s make some difference. My workaround is to modify one line in DisplayType class. I would change the code so the minimum fraction digits for Cost+Price is taken from System Configuration that I can manage later. It even gives me better flexibility!<\/p>\n<blockquote><p>else if (displayType == CostPrice)<br \/>\n{<br \/>\nformat.setMaximumIntegerDigits(MAX_DIGITS);<br \/>\nformat.setMaximumFractionDigits(MAX_FRACTION);<br \/>\nformat.setMinimumFractionDigits(<br \/>\nMSysConfig.getIntValue(&#8220;DISPLAY_TYPE_COSTPRICE_FRACTION&#8221;, AMOUNT_FRACTION, Env.getAD_Client_ID(Env.getCtx())));<br \/>\n}<\/p><\/blockquote>\n<p>In implementation you would probably need to have a numeric display type where it can support more than 2 number of digits in the fraction portion. I hope the modification I share with you today can help you in this situation.<\/p>\n<p>&#8212;<\/p>\n<p>Goodwill Consulting is a long time Adempiere \/ Idempiere supporter since their inception. We are offering software-as-a-service solution on the cloud based on Adempiere \/ Idempiere. For more information, you can drop us a visit at <a title=\"Goodwill ERP\" href=\"http:\/\/www.goodwillerp.com\" target=\"_blank\">www.goodwillerp.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi all, Today I would like to share my approach to provide\u00a0 flexible precision in numeric display type. As you know there are several numeric display types in Adempiere \/ Idempiere. You can find them in the list of Reference Type in Table &amp; Column window. You can see you can have either Number, Amount, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[47],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-adempiere-tips-tricks","tag-precision-display-type-idempiere"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Flexible Precision In Numeric Display Type - Goodwill Consulting<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Flexible Precision In Numeric Display Type - Goodwill Consulting\" \/>\n<meta property=\"og:description\" content=\"Hi all, Today I would like to share my approach to provide\u00a0 flexible precision in numeric display type. As you know there are several numeric display types in Adempiere \/ Idempiere. You can find them in the list of Reference Type in Table &amp; Column window. You can see you can have either Number, Amount, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/\" \/>\n<meta property=\"og:site_name\" content=\"Goodwill Consulting\" \/>\n<meta property=\"article:published_time\" content=\"2013-11-22T08:19:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-11-22T08:26:58+00:00\" \/>\n<meta name=\"author\" content=\"Armen Rizal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Armen Rizal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/\"},\"author\":{\"name\":\"Armen Rizal\",\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/person\/f0f72bd8c594649975fe804decbab5db\"},\"headline\":\"Flexible Precision In Numeric Display Type\",\"datePublished\":\"2013-11-22T08:19:38+00:00\",\"dateModified\":\"2013-11-22T08:26:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/\"},\"wordCount\":301,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#organization\"},\"keywords\":[\"precision display type idempiere\"],\"articleSection\":[\"Adempiere Tips &amp; Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/\",\"url\":\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/\",\"name\":\"Flexible Precision In Numeric Display Type - Goodwill Consulting\",\"isPartOf\":{\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#website\"},\"datePublished\":\"2013-11-22T08:19:38+00:00\",\"dateModified\":\"2013-11-22T08:26:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.goodwill.co.id\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Flexible Precision In Numeric Display Type\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#website\",\"url\":\"https:\/\/www.goodwill.co.id\/blog\/\",\"name\":\"Goodwill Consulting\",\"description\":\"Goodwill ERP - Adempiere Indonesia - Idempiere Indonesia\",\"publisher\":{\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.goodwill.co.id\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#organization\",\"name\":\"Goodwill Consulting\",\"url\":\"https:\/\/www.goodwill.co.id\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.goodwill.co.id\/blog\/wp-content\/uploads\/2024\/07\/logo_goodwillerp.jpg\",\"contentUrl\":\"https:\/\/www.goodwill.co.id\/blog\/wp-content\/uploads\/2024\/07\/logo_goodwillerp.jpg\",\"width\":900,\"height\":599,\"caption\":\"Goodwill Consulting\"},\"image\":{\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/person\/f0f72bd8c594649975fe804decbab5db\",\"name\":\"Armen Rizal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dd9c02aae88ac1440023f6c7ed15bbdb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dd9c02aae88ac1440023f6c7ed15bbdb?s=96&d=mm&r=g\",\"caption\":\"Armen Rizal\"},\"url\":\"https:\/\/www.goodwill.co.id\/blog\/author\/armen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Flexible Precision In Numeric Display Type - Goodwill Consulting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/","og_locale":"en_US","og_type":"article","og_title":"Flexible Precision In Numeric Display Type - Goodwill Consulting","og_description":"Hi all, Today I would like to share my approach to provide\u00a0 flexible precision in numeric display type. As you know there are several numeric display types in Adempiere \/ Idempiere. You can find them in the list of Reference Type in Table &amp; Column window. You can see you can have either Number, Amount, [&hellip;]","og_url":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/","og_site_name":"Goodwill Consulting","article_published_time":"2013-11-22T08:19:38+00:00","article_modified_time":"2013-11-22T08:26:58+00:00","author":"Armen Rizal","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Armen Rizal","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/#article","isPartOf":{"@id":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/"},"author":{"name":"Armen Rizal","@id":"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/person\/f0f72bd8c594649975fe804decbab5db"},"headline":"Flexible Precision In Numeric Display Type","datePublished":"2013-11-22T08:19:38+00:00","dateModified":"2013-11-22T08:26:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/"},"wordCount":301,"commentCount":0,"publisher":{"@id":"https:\/\/www.goodwill.co.id\/blog\/#organization"},"keywords":["precision display type idempiere"],"articleSection":["Adempiere Tips &amp; Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/","url":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/","name":"Flexible Precision In Numeric Display Type - Goodwill Consulting","isPartOf":{"@id":"https:\/\/www.goodwill.co.id\/blog\/#website"},"datePublished":"2013-11-22T08:19:38+00:00","dateModified":"2013-11-22T08:26:58+00:00","breadcrumb":{"@id":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.goodwill.co.id\/blog\/flexible-precision-in-numeric-display-type\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.goodwill.co.id\/blog\/"},{"@type":"ListItem","position":2,"name":"Flexible Precision In Numeric Display Type"}]},{"@type":"WebSite","@id":"https:\/\/www.goodwill.co.id\/blog\/#website","url":"https:\/\/www.goodwill.co.id\/blog\/","name":"Goodwill Consulting","description":"Goodwill ERP - Adempiere Indonesia - Idempiere Indonesia","publisher":{"@id":"https:\/\/www.goodwill.co.id\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.goodwill.co.id\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.goodwill.co.id\/blog\/#organization","name":"Goodwill Consulting","url":"https:\/\/www.goodwill.co.id\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.goodwill.co.id\/blog\/wp-content\/uploads\/2024\/07\/logo_goodwillerp.jpg","contentUrl":"https:\/\/www.goodwill.co.id\/blog\/wp-content\/uploads\/2024\/07\/logo_goodwillerp.jpg","width":900,"height":599,"caption":"Goodwill Consulting"},"image":{"@id":"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/person\/f0f72bd8c594649975fe804decbab5db","name":"Armen Rizal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.goodwill.co.id\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dd9c02aae88ac1440023f6c7ed15bbdb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd9c02aae88ac1440023f6c7ed15bbdb?s=96&d=mm&r=g","caption":"Armen Rizal"},"url":"https:\/\/www.goodwill.co.id\/blog\/author\/armen\/"}]}},"_links":{"self":[{"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/posts\/71"}],"collection":[{"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":5,"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.goodwill.co.id\/blog\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}