{"id":1165,"date":"2008-02-29T03:45:31","date_gmt":"2008-02-29T09:45:31","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/docs\/?page_id=1165"},"modified":"2024-01-26T11:15:59","modified_gmt":"2024-01-26T17:15:59","slug":"edit-codes-in-servlets","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/edit-codes-in-servlets","title":{"rendered":"Format Codes"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p>Numeric fields are stored in the database without any formatting whatsoever. Apply format (sometimes called edit codes as well) codes to numeric fields allows you to add formatting to make your numerical values more readable for your end-user. For instance instead of showing your user a value of 9876532, a format code would allow you to instead show the value as $9,876,532. The value, of course is the same but the additional formatting makes it much easier to quickly read and better understand the value.<\/p>\n\n\n\n<p>m-Power ships with many format codes by default (see table below), but you can also create your own custom format codes as well.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Overview<\/h3>\n\n\n\n<p>Defined edit codes are stored in a text file \/mrcjava\/mrcclasses\/editcode.txt which includes default and mrc pre-defined codes. The mrc pre-defined codes are called user defined code, so you can either change or define your new edit code within this section.<\/p>\n\n\n\n<p><strong><em>Summary of Default Edit Codes<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>Edit Code Name<\/td><td>Commas<\/td><td>Decimal point<\/td><td>Sign for Negative<\/td><td>Decimal or Blank<\/td><td>Positive Example<\/td><td>Negative Example<\/td><\/tr><tr><td>None<\/td><td>No<\/td><td> No <\/td><td>No Sign<\/td><td><\/td><td>1234567<\/td><td>1234567<\/td><\/tr><tr><td>1<\/td><td>Yes<\/td><td> Yes <\/td><td>No Sign<\/td><td>.00 or 0<\/td><td>12,345.67<\/td><td>12,345.67<\/td><\/tr><tr><td>2<\/td><td>Yes <\/td><td> Yes <\/td><td>No Sign<\/td><td>Blanks<\/td><td>12,345.67 <\/td><td>12,345.67 <\/td><\/tr><tr><td>3<\/td><td>No <\/td><td> Yes <\/td><td>No Sign<\/td><td> .00 or 0 <\/td><td>12345.67<\/td><td>12345.67<\/td><\/tr><tr><td>4<\/td><td>No <\/td><td> Yes <\/td><td>No Sign <\/td><td>Blanks<\/td><td>12345.67<\/td><td>12345.67<\/td><\/tr><tr><td>A<\/td><td>Yes <\/td><td> Yes <\/td><td>CR <\/td><td> .00 or 0 <\/td><td>12,345.67<\/td><td>12,345.67CR<\/td><\/tr><tr><td>B<\/td><td>Yes <\/td><td> Yes <\/td><td>CR <\/td><td>Blanks<\/td><td>12,345.67 <\/td><td>12,345.67 <\/td><\/tr><tr><td>C<\/td><td>No <\/td><td> Yes <\/td><td>CR <\/td><td> .00 or 0 <\/td><td>12345.67<\/td><td>12345.67CR<\/td><\/tr><tr><td>D<\/td><td>No <\/td><td> Yes <\/td><td>CR  <\/td><td>Blanks<\/td><td>12345.67<\/td><td>12345.67CR<\/td><\/tr><tr><td>J<\/td><td>Yes <\/td><td> Yes <\/td><td>&#8211; (minus)<\/td><td> .00 or 0 <\/td><td>12,345.67<\/td><td>12,345.67-<\/td><\/tr><tr><td>K<\/td><td>Yes <\/td><td> Yes <\/td><td>&#8211; (minus)<\/td><td>Blanks<\/td><td>12,345.67<\/td><td>12,345.67-<\/td><\/tr><tr><td>L<\/td><td>No <\/td><td> Yes <\/td><td>&#8211; (minus)<\/td><td> .00 or 0 <\/td><td>12345.67<\/td><td>12345.67-<\/td><\/tr><tr><td>M<\/td><td>No <\/td><td> Yes <\/td><td>&#8211; (minus) <\/td><td>Blanks<\/td><td>12345.67<\/td><td>12345.67-<\/td><\/tr><tr><td>Y<\/td><td>No <\/td><td> No <\/td><td>No Sign <\/td><td><\/td><td>1234567<\/td><td>1234567<\/td><\/tr><tr><td>Z<\/td><td>No <\/td><td> No <\/td><td>No Sign  <\/td><td><\/td><td>1234567<\/td><td>1234567<\/td><\/tr><tr><td>N<\/td><td>Yes <\/td><td> Yes <\/td><td>&#8211; (floating) <\/td><td>.00 or 0<\/td><td>12,345.67<\/td><td>-12,34567<\/td><\/tr><tr><td>O<\/td><td>Yes <\/td><td> Yes <\/td><td>&#8211; (floating) <\/td><td>Blanks<\/td><td>12,345.67<\/td><td>-12,34567<\/td><\/tr><tr><td>P<\/td><td>No <\/td><td> Yes <\/td><td>&#8211; (floating) <\/td><td>.00 or 0 <\/td><td>12345.67<\/td><td>-12345.67<\/td><\/tr><tr><td>Q<\/td><td>No<\/td><td> Yes <\/td><td>&#8211; (floating) <\/td><td>Blanks<\/td><td>12345.67<\/td><td>-12345.67<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">All edit codes displayed above suppress the printing of leading zeros.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><em>Specifying Your own Edit Word<\/em><\/strong><\/h3>\n\n\n\n<p>The following is a brief explanation of the rules for defining an edit word.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\n<p>&#8212; Any character other than a space, ampersand (&amp;), zero, asterisk (*), decimal point (.), comma (,), minus sign (-), or CR will be treated as a literal and will be printed wherever it occurs.<\/p>\n<p>&#8212; No literal will be printed which occurs to the left of the first significant digit in a number.<\/p>\n<p>&#8212; A blank in the edit word will be replaced with the digit from the corresponding position of the data field.<\/p>\n<p>&#8212; An ampersand will be replaced by a space.<\/p>\n<p>&#8212; To stop suppression of leading zeros, place a zero or an asterisk in the farthest right position where zero suppress is to stop. A zero will cause leading zeros to be replaced with spaces. An asterisk will cause leading zeros to be replaced with asterisks.<\/p>\n<p>&#8212; Either a minus sign or CR may be used to indicate a negative number. Whichever one is used, it must appear to the right of the last digit in the number. If a number is positive, the minus sign or CR will be replaced by spaces.<\/p>\n<p>&#8212; Commas or decimal points which occur to the left of the first significant digit of a number will not be printed.<\/p>\n<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>As an example of how these rules are applied, the following is the edit word customer account number where the first six digits are the base customer number and the last three digits are a location code:<\/p>\n\n\n\n<p>0____-___ where the underscores indicate spaces.<\/p>\n\n\n\n<p>The zero indicates that leading zero suppression stops in the first digit of the customer number. The minus sign is treated as a literal since it is not to the right of the last digit in the number. If a customer&#8217;s account number was 000234001, this edit word would cause the number to be displayed as 00234-001.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">You will notice that when you enter the edit word m-Power right justifies the edit word. This is intentional and required for your edit code to function properly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Numeric fields are stored in the database without any formatting whatsoever. Apply format (sometimes called edit codes as well) codes to numeric fields allows you to add formatting to make your numerical values more readable for your end-user. For instance instead of showing your user a value of 9876532,&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[266],"ht-kb-tag":[],"class_list":["post-1165","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-general"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/1165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/comments?post=1165"}],"version-history":[{"count":16,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/1165\/revisions"}],"predecessor-version":[{"id":14023,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/1165\/revisions\/14023"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/media?parent=1165"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=1165"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=1165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}