multiply variables and round
Hello!
I will rounded the Result from tthis Strings in Bar Tender Automation to 2 decimal places. Now I get 4 decimal places.
Format.NamedSubStrings("Gewicht").Value*Format.NamedSubStrings("Preis_pro_kilo").Value
If I get a result with a zero at the end of only one decimal place is displayed. For instance
2,00*2,00 = 4,0 and not 4,00
Thanks
-
Brandon Morrisey
★ BarTender Hero ★
I think you may want to use the round function in VB script (copy of help file content on this function below).
Round Function
Round Function
Returns a number rounded to a specified number of decimal places.
Round(expression[, numdecimalplaces])Arguments
expression
Required. Numeric expression being rounded.
numdecimalplaces
Optional. Number indicating how many places to the right of the decimal are included in the rounding. If omitted, integers are returned by the Round function.
Remarks
The following example uses the Round function to round a number to two decimal places:
Dim MyVar, pi pi = 3.14159 MyVar = Round(pi, 2) ' MyVar contains 3.14.0
Please sign in to leave a comment.
Comments
1 comment