Railo
  1. Railo
  2. RAILO-2139

Add a second parameter to the round function that allows to define the precision

    Details

    • Type: Feature Request Feature Request
    • Status: Resolved Resolved (View Workflow)
    • Priority: Minor Minor
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.1.0.000
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      At the moment round() only rounds whole numbers. So 1.94 rounds to 2 and 1.64 to 2 as well. If we could add a second param that defines the precision like follows: round(1.94, 1) then it would round to 1.9 and round(1.64, 1) would round to 1.6. With higher precision the numbers would round accordingly.
      So for instance round(1.94872, 3) would round to: 1.949

        Activity

        Hide
        Mark Drew
        added a comment -

        Adding Pull request

        Show
        Mark Drew
        added a comment - Adding Pull request
        Show
        Michael Offner
        added a comment - tnx for input https://github.com/getrailo/railo/commit/bc5df1cf8403e1196425b59fc56480a4f925c04b https://github.com/getrailo/railo/commit/b2c1c615279d0abc49381d7990d3dd5d3b1b48af

          People

          • Assignee:
            Michael Offner
            Reporter:
            Gert Franz
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: