Home > Contents > Index >
CALCULATOR.GO
Calculates the value of an expression.
Syntax
<CALCULATOR.GO VALUE="postfixstring"
VARNAME="result"/>Parameters
VALUE (required)- Input parameter. Postfix expression as a string with the following format:
- "
opreand1 operand2 ... operandn opchar"
- where
operand1,operand2, ...,operandnare one or more operands, andopcharis one of the following operator characters or strings:
+-*/%=!=LTGTLTEGTEANDORNOTAll values are separated by spaces, and the entire VALUEinput string is contained within double quotes.
VARNAME (required)Input and output parameter. As input, name of a string that holds the output that results from evaluating the expression.
Description
The value is computed using reverse polish notation. Numbers in the expression string are pushed onto a stack. Operations pop numbers off the stack as needed and push the result. The final answer is the top element of the stack.
Example
<!-- Divide total price by item quantity to get the item price. --> <CALCULATOR.GO VALUE="cartlist.price cartlist.quantity /" VARNAME="calcout"/> <!-- Convert the above item price to currency. --> <CURRENCY.CREATE NAME="curval"/> <CURRENCY.GETCURRENCY NAME="curval" VALUE="Variables.calcout" VARNAME="curout"/>
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.