Uploaded image for project: 'Elements Checklist'
  1. Elements Checklist
  2. CL-273

Be able to specify number of decimals (Mantissa)

    XMLWordPrintable

    Details

      Description

      Motivation

      Hi
      It would be nice to be able to specify the number of decimals for the calcualtion structure type in Elements.
      I'm using Velocity in Elements to calculate ratio between Interger and float and I get a result like "3.463200356378983".
      It would be nice to be able to configure the number of significant figures.

      Impacts

      Admin

      New option on "Calculation" attributes:

      • Name: Mantissa
      • Type: Checkbox
      • Default value: Unchecked
      • Description: Force number of decimals.

      When checked, an input of type Number is displayed - where the admin can select the number of digits to display:

      • Type: Input (number)
      • Default value: 2
      • Min: 0
      • Max: 9
      • Description: Specify number of decimals to display [0-9].
         

      Runtime

      When "Mantissa" is active, all calculation display values are forced to have a specified number of decimals

      Footers are computed on the raw (original) values

      Label Raw value Displayed value
      Blah 1.056 1.06
      Bloh 1.056 1.06
        Sum 2.11

      In the example above, the footer is computed on the Raw values, not the Display values (otherwise it would be 2.12).

      Mantissa

      Examples

      Raw value Mantissa Rounded value
      1.004 2 1.00
      1.005 2 1.01
      1.08 3 1.080
      123 2 123.00
      1.51 0 2
      1.49 0 1
      1.50 0 2
      -1.51 0 -2
      -1.49 0 -1
      -1.50 0 -1

      Java API

      The PanelRenderingService.renderPanel() method shall return rounded values

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                florian.bonniec@valiantys.com Florian Bonniec
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: