$WBROUND - rounds number value to specified number of decimal places
Availability
$WBROUND is available for use with all WBSP commands.
Syntax
$WBROUND{number|decimals}
$WBROUND[number|decimals]
Parameters
number - the number to be rounded
decimals - optional parameter containing number of decimal places. Default value is 0 (round to integer).
Returns
Number value rounded to specified decimal places.
Example
<!--
[FormFields]
wb_command=r
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>WBRound</title>
</head>
<body>
Original number: $wbsetv[number|41488.53617|T]<br>
Integer: $wbround[$wbgetv[number]]<br>
Two decimal
places: $wbround[$wbgetv[number]|2]<br>
Three decimal places:
$wbround[$wbgetv[number]|3]<br>
Four decimal places:
$wbround[$wbgetv[number]|4]
</body>
</html>
After running this example you should get the
following:
Original number:
41488.53617
Integer: 41489
Two decimal places: 41488.54
Three decimal
places: 41488.536
Four decimal places: 41488.5362