Leave feedback
  • mround function implementation in StreamServe

Write an Article
Tuesday 11 August, 2015
Rajkumar Aoutade Rajkumar Aoutade
1 likes 2240 views

The MROUND returns a number that is rounded to the nearest instance of a specified multiple The syntax of the MROUND function is:

MROUND(number,multiple)

 

The MROUND returns a number that is rounded to the nearest instance of a specified multiple - hence the M in front of ROUND. The syntax of the MROUND function is:
MROUND(number,multiple)

 

The MROUND returns a number that is rounded to the nearest instance of a specified multiple

The syntax of the MROUND function is:

MROUND(number,multiple)

How to write mround function in StreamServe scripting.

For mround functionality we need two values one to which we are going to find the nearest value and another is for specified value (in terms of multiple)

Below script shows how to write mround  function in StreamServe.

Implementation :

func mround(){

//first parameter of function

num value = num(#1);

//second parameter of function

num inMultiple = num(#2);
//caluculating mround value

str mroundValue = str(round(value/inMultiple, 0) * inMultiple);

return mroundValue;

}

Use :

Using this mround function you can find any nearest value in the given mutliple and it is very useful in showing graph pick value.

Examples :

1) 

mround (5999, 500) will return 6000;

2)

mround(3001, 600) will return 3000;

 

 

 

Comments (0)

   


Post comment