Skip to Content mrc logo mrc logo
  • What is m-Power?
    Overview Demos Build Process Case Studies Specs Pricing Trial
    m-Power Resources
    Overview How-To Videos Webinars & Podcasts White Papers Fact Sheets
  • What does m-Power build?
    Solutions by Industry
    Overview Database Front-Ends AI Reporting CRM Systems Business Intelligence Dashboards Inventory Management Mobile Apps ERP Enhancements Modernization
    Spreadsheets to the Web MS Access to the Web B2B/Web Portals Scheduling Embedded Analytics Web Forms Workflow Data Exploration Budgeting & Forecasting APIs & Web Services Db2 Web Query Alternative
    Solutions by Industry
    Overview Manufacturing Government Foodservice Software Vendors Logistics & Supply Chain Software Consultants Healthcare
  • Development Services Training Mentoring
  • Overview Partners Press Releases Careers Events Contact Blog
  • Support Home FAQ Documentation Customer Portal Enhancements Updates Roadmap Techblog
Try m-Power

m-Power Manual

Browse:

  • Home
  • Freemarker
  • HTML Edit Codes to Control Data Rounding
Back to Manual

Using HTML Edit Codes to Control Data Rounding

 

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.

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.

Before any editing is done, my output looks like this:

Since this requires HTML editing, we must open m-Painter.

Right-click on your field at the detail level, and select "Cell" then "Edit Cell HTML". Replace ?html} with _o?string("$,##0")}.

Be sure to repeat the process for your field on the sub-total and grand-total rows.

Click the "Save" button & run your application. My output now looks like this:

Note: The Original Field was left unaltered to show the comparison between itself and the HTML edited field.

Note: You can utilize numerous formatting, such as (Assuming the Field value is 1.234):

· ${FIELD_o?string("0")} <– yields 1

· ${FIELD_o?string("0.#")} <– yields 1.2

· ${FIELD_o?string("0.##")} <– yields 1.23

· ${FIELD_o?string("0.###")} <– yields 1.234

· ${FIELD_o?string("0.####")} <– yields 1.234

You can even use this same method for Rounding purposes:

· If Field = 1.2, then ${FIELD.string("0")} yields 1.

· If Field = 1.8, then ${FIELD.string("0")} yields 2.

· If Field = 1.5, then ${FIELD.string("0")} yields 2 (Rounding always goes to nearest Even Number).

· If Field = 2.5, then ${FIELD.string("0")} yields 2 (Rounding always goes to nearest Even Number).

 

Created: February 29, 2008 | Modified: September 3, 2013

Search


Browse By Category

Build Process (13)
Starting with m-Power (8)
Retrievals (10)
Reports (15)
Summaries (4)
Maintainers (17)
Graphs (8)
m-Power Data Explorer (4)
General (24)
Calculations (5)
Utilities (9)
m-Power Administration (23)
Security (11)
Freemarker (6)
m-Painter (29)
Form Validation (5)
External Objects & UDFs (12)
Deprecated Documentation (23)
Bootstrap Templates (7)

Popular Tags

Graphing Popular Java Database SQL m-Painter Tomcat Performance RPG DB2 Maintainers Dropdowns Reports Dates Graph Properties Production Retrievals Prompt Screens Administration Compiling Excel Application Properties Bootstrap Templates Retrieval Freemarker Build Process Data Dictionary Advanced Calculations Email External Objects Getting Started Summaries Report Maintainer mrc-Productivity Series App Properties Parameters Form Validation Record Selections Graphs Security Admin Video Bar Graphs

See all tags »

mrc

Build the custom apps and AI tools your business needs with m-Power, or have our Chicago-based team build them with you. One platform, one team that makes sure you succeed.

Since 1981 · 1,500+ customers · 4.7/5 on G2

m-Power
Overview Demos Build Process Licensing Specs Get a Demo
Solutions
Database Front-Ends Reporting AI Tools Dashboards ERP Enhancements Modernization See all solutions
Company
Case Studies Services About Blog Careers Contact Support

Privacy Policy Cookie Policy Cookie Settings

michaels, ross & cole, ltd. (mrc)
US: 2001 Midwest Road, Suite 310, Oak Brook, IL 60523 · 630-916-0662
UK: Mortlake Business Centre, 20 Mortlake High Street, London, SW14 8JN · +44-20-335-59566
© mrc. All rights reserved.