v5.0
Exposes the VBScript Round function for use by other script languages. The JScript Math.round method always returns an integer result, whereas this command is more versatile because it can limit the number of decimal places of a floating point number.
oReturn = XSIRound( in_Expression, [in_NumDecimals] ); |
Return the rounded number
Parameter | Type | Description |
---|---|---|
in_Expression | Any number, but normally this would be a Double or Float | Number to Round |
in_NumDecimals | Long | Number of decimal points to leave in the returned value.
Default Value: 0 |
//INFO : 5 Application.LogMessage( XSIRound( 5.123 ) ) ; //INFO : 5.1 Application.LogMessage( XSIRound( 5.123, 1 ) ) ; //INFO : 5.123 Application.LogMessage( XSIRound( 5.123, 5 ) ) ; //INFO : 0.333333333333333 Application.LogMessage( 1/3 ) ; //INFO : 0.33 Application.LogMessage( XSIRound( 1/3, 2 ) ) ; |