Announcement

Collapse
No announcement yet.

Round to nearest?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Round to nearest?

    anyone have a good routine to round a number to the nearest defined tick value?

    I wrote one to round to every 25 or 50 but it doesn't work for others values.

    Would like a function like

    round(value, n) where n= the minimum tick

    so if n=25 & value =2.78

    the result would be 2.75
    (takes half the tick value and round down if below mid point above if above midpoint)

    anyone done anything this elaborate?

    thx

  • #2
    Todd
    You may want to check the script Steve Hare posted here
    Alex

    Comment


    • #3
      hi Alex/Steve,

      Where can I find reference to efs_extension feature? as Steve had used in his rounding efs : round_efs_extension()?

      Comment


      • #4
        Hi Z11,

        EFS uses JavaScript 1.5 as a basis for this platform and eSignal has extended it's functionality by adding a number of built in class definitions. This is where the EFS predefined functions come in, where you establish an instance of a class to use that predefined functionality, e.g. the stochastic class for example. Then you use the instance you have established to execute methods within the class.

        I have been putting together some class definitions I like to refer to as extensions to the functionality (classes) already in efs. They have to be contained in the efs's which use them and are created and defined in the code at run time. You will see several of these contained in my alternate efs thread link

        Comment

        Working...
        X