{"id":1399,"date":"2008-02-29T03:45:41","date_gmt":"2008-02-29T09:45:41","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/legacy\/?page_id=1399"},"modified":"2013-09-03T14:40:55","modified_gmt":"2013-09-03T19:40:55","slug":"html-edit-codes-to-control-data-rounding","status":"publish","type":"page","link":"https:\/\/www.mrc-productivity.com\/legacy\/freemarker\/html-edit-codes-to-control-data-rounding","title":{"rendered":"HTML Edit Codes to Control Data Rounding"},"content":{"rendered":"<p><!-- Begin Content --><\/p>\n<h1>Using HTML Edit Codes to Control Data Rounding<\/h1>\n<p>&nbsp;<\/p>\n<p>This documentation describes how to use HTML edit codes to hide a decimal field from view, while still allowing it to be used in calculating sub and grand total levels.<\/p>\n<p>To begin with, be sure to use the Web 2.0 Report template when building your application.<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/datarounding1.jpg\" alt=\"\" \/><\/p>\n<p>So that you can easily see the difference, an application has been built, sequenced by State. Only one Numeric Field has been selected. For comparison purposes, a calculation has been used to replicate this numeric field.<\/p>\n<p>Before any editing is done, my output looks like this:<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/datarounding2.jpg\" alt=\"\" \/><\/p>\n<p>Since this requires HTML editing, we must open m-Painter.<\/p>\n<p>Right-click on your field at the detail level, and select &quot;Cell&quot; then &quot;Edit Cell HTML&quot;. Replace <code>?html}<\/code> with <code>_o?string(\"$,##0\")}<\/code>.<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/datarounding3.jpg\" alt=\"\" \/><\/p>\n<p>Be sure to repeat the process for your field on the sub-total and grand-total rows.<\/p>\n<p>Click the &quot;Save&quot; button &amp; run your application. My output now looks like this:<\/p>\n<p><img decoding=\"async\" class=\"border\" src=\"\/legacy\/images\/datarounding4.jpg\" alt=\"\" \/><\/p>\n<p><strong>Note:<\/strong> The Original Field was left unaltered to show the comparison between itself and the HTML edited field.<\/p>\n<p><strong>Note:<\/strong> You can utilize numerous formatting, such as (Assuming the Field value is 1.234):<\/p>\n<p>\u00b7 <code>${FIELD_o?string(\"0\")}<\/code> &lt;&#8211; yields 1<\/p>\n<p>\u00b7 <code>${FIELD_o?string(\"0.#\")}<\/code> &lt;&#8211; yields 1.2<\/p>\n<p>\u00b7 <code>${FIELD_o?string(\"0.##\")}<\/code> &lt;&#8211; yields 1.23<\/p>\n<p>\u00b7 <code>${FIELD_o?string(\"0.###\")}<\/code> &lt;&#8211; yields 1.234<\/p>\n<p>\u00b7 <code>${FIELD_o?string(\"0.####\")}<\/code> &lt;&#8211; yields 1.234<\/p>\n<p>You can even use this same method for Rounding purposes:<\/p>\n<p>\u00b7 If Field = 1.2, then <code>${FIELD.string(\"0\")}<\/code> yields 1.<\/p>\n<p>\u00b7 If Field = 1.8, then <code>${FIELD.string(\"0\")}<\/code> yields 2.<\/p>\n<p>\u00b7 If Field = 1.5, then <code>${FIELD.string(\"0\")}<\/code> yields 2 (Rounding always goes to nearest Even Number).<\/p>\n<p>\u00b7 If Field = 2.5, then <code>${FIELD.string(\"0\")}<\/code> yields 2 (Rounding always goes to nearest Even Number).<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using HTML Edit Codes to Control Data Rounding &nbsp; This documentation describes how to use HTML edit codes to hide a decimal field from view, while still allowing it to be used in calculating sub and grand total levels. To begin with, be sure to use the Web 2.0 Report template when building your application. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1352,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1399","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/comments?post=1399"}],"version-history":[{"count":9,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1399\/revisions"}],"predecessor-version":[{"id":6337,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1399\/revisions\/6337"}],"up":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1352"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/media?parent=1399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}