Rounding

Follow

Comments

2 comments

  • Avatar
    Service Desk

    Ryan had a similar issue, via email:

    I have a few places in my form where I need to calculate the age of Children.  I have used the Math functions following the example on page 112 of the manual – i.e. {Days:  {Field:  DOB}, {NOW}}/365.25.

    The problem with this approach is that the age will be one year older whenever the person is more than 6 months past his/her birthday.  For example, if I was born on 4-30-74.  Using the approach above will deliver the right result as long as today (NOW) is less than 6 months past my last birthday.  See the table below.  You have a function for ROUND but that will round up.  If there was a ROUND DOWN function, that would seem to fix the problem.  Am I missing something?  Thanks for your input.

    Today

    DOB

    Age

    Rounded Age

    4/30/2013

    4/30/1974

    39.00068446

    39

    5/30/2013

    4/30/1974

    39.08281999

    39

    6/30/2013

    4/30/1974

    39.16769336

    39

    7/30/2013

    4/30/1974

    39.24982888

    39

    8/30/2013

    4/30/1974

    39.33470226

    39

    9/30/2013

    4/30/1974

    39.41957563

    39

    10/29/2013

    4/30/1974

    39.49897331

    39

    11/30/2013

    4/30/1974

    39.58658453

    40

    12/30/2013

    4/30/1974

    39.66872005

    40

    1/30/2014

    4/30/1974

    39.75359343

    40

    2/28/2014

    4/30/1974

    39.8329911

    40

    3/30/2014

    4/30/1974

    39.91512663

    40

    4/30/2014

    4/30/1974

    40

    40

    0
    Comment actions Permalink
  • Avatar
    Service Desk

    The current edition (v2.6) of the Expert User Guide (available online here) covers this well on pages 112-113, showing the correct math command in TheFormTool is INTEGER. While ROUND will change the computed answer to its closest whole number, regardless whether that whole number is more or less, INTEGER will always "round down" to the nearest whole number. Using INTEGER in Ryan's examples shown above will result in "39" in every case.

    Here is what the manual says:

    Page_113.jpg

     

    0
    Comment actions Permalink

Please sign in to leave a comment.