Published on : September 14, 2020
Title : if.smaller_than
Purpose : This condition to check the value is Smaller than given value.
Syntax : [if.smaller_than lhs=’Value_1′ rhs=’Value_2′]
//** Do something if LHS value is smaller than RHS value **//
[/if.smaller_than]
Input Parameters :
lhs : left hand side value to check the value is smaller than rhs
rhs : right hand side value to fullfill if condition
Return Value : Return true/false
Example 1 :
Code :
[template.set value_1 = 100/]
[template.set value_2 = 200/]
[if.smaller_than lhs={template.value_1} rhs={template.value_2}]
value_1 is smaller than value_2
[/if.smaller_than]
Output : value_1 is smaller than value_2.
Description : In the example, lhs value_1 variable is declered and it’s store value is 100 also rhs value_2 variable and it’s stroe value is 200. As the variable value_1 is smaller than value_2 variable, then condition will get satisfied the logic inside will get executed.
Example 2 :
Code :
[template.value_1 = 300/]
[template.value_2 = 200/]
[if.smaller_than lhs={template.value_1} rhs={template.value_2}]
Condition is true.
[/if.smaller_than]
Output :
Description : In the example, lhs value_1 variable is declered and it’s store value is 300 also rhs value_2 variable and it’s stroe value 200. As the variable value_1 is greater than value_2 variable, then condition will not get satisfied the logic inside will not get executed.