rounding
Moderators: JRL, Dorian (MJT support)
Try this.
Code: Select all
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
VBStart
VBEND
//Round(expression[,numdecimalplaces])
//Parameter Description
//------------------------------------------------------------------------------
//expression Required. The numeric expression to be rounded
//numdecimalplaces Optional. Specifies how many places to the right
// of the decimal are included in the rounding.
// Default is 0
Let>mynum=5.06
VBEval>Round("%mynum%","1"),result
MessageModal>%result%
thanks, I made this too for cutting off decimals, it can be modified to round too. I just don't understand why common math functions are so difficult to get to in macrosheduler; I've also had to build my own factorial script too; so frustrating to do that when one ! is all I want
teach a man to fish: I know nothing of vb, is there an easy way to get an explanation and list of common formulas ... or something?
teach a man to fish: I know nothing of vb, is there an easy way to get an explanation and list of common formulas ... or something?
Code: Select all
Position>.,d,1,StartPos
sub>StartPos,1
MidStr>d,1,StartPos,somevalue
VBScript Functions
http://www.w3schools.com/VBscript/vbscr ... ctions.asp
Google can probably dig up quite a few more good references as well.
http://www.w3schools.com/VBscript/vbscr ... ctions.asp
Google can probably dig up quite a few more good references as well.
Rounding made easy.
One line, no VBScript, using built in Macro Scheduler functionality
One line, no VBScript, using built in Macro Scheduler functionality to round to three decimal places.
See http://www.mjtnet.com/OnlineHelp/arithm ... ctions.htm for more built in math functions.
One line, no VBScript, using built in Macro Scheduler functionality
Code: Select all
Let>number=123.12345
Let>roundednumber={round (%number%)}
One line, no VBScript, using built in Macro Scheduler functionality to round to three decimal places.
Code: Select all
Let>number=123.12345
Let>rounded3number={(round (1000*%number%))/1000}