Vb Script For Conditional Expression
Hi,
I'm migrating from LabelView 8 to Bartender 2016 R2 and I'm requiring assistance with creating a VB Script, I think, to replace the below expression that is currently being used in LabelView:
if(weightPerRecipeUnit >= 1000, div(weightPerRecipeUnit, 1000) + "Kg", Round(weightPerRecipeUnit,0) + "g")
I can configure the condition, using the "When to Print" function, but I can't insert the algebraic expressions in this function; I presume this needs to occur via a VB script?
I'm not familiar with VB so any assistance is very much appreciated.
Thanks,
Andrew
-
Update
The below seem to work but how do I append a string ('g' or 'kg') to the end of the values?
If Field("weightPerRecipeUnit")>= 1000 Then
value = Field("weightPerRecipeUnit")/1000
Else
value = Round(Field("weightPerRecipeUnit"))
End If
Thanks,
Andrew
0 -
Try:
Value = (Field"weightPerRecipeUnit")/1000) & "Kg"
And:
Value = Round(Field("weightPerRecipeUnit")) & "g"
0 -
Many thanks KM. Works as required.
0
Please sign in to leave a comment.
Comments
3 comments