Reason I am saying is that I wrote a cal to demo session and
the param could not be added out of the box. I have to make use of ' *
parseFloat'*
See code below.
<%
var operation = request.getParameter("operation");
var value1 = parseFloat( request.getParameter("value1") );
var value2 = parseFloat( request.getParameter("value2") );
var result = 0;
var memory = 0;
if (operation == "add" ) {
result = value1 + value2;
} else if (operation == "sub" ) {
result = value1 - value2;
} else if (operation == "mul" ) {
result = value1 * value2;
} else if (operation == "div" ) {
result = value1 / value2;
} else if (operation == "mem" ) {
memory = session.get("result");
result = memory + value1;
}
session.put("result", result);
if (operation == "mem" ) {
print( memory + " + " + value1 + " = " + result );
} else {
print( value1 + " " + operation + " " + value2 + " = " + result );
}
%>
On Mon, Mar 5, 2012 at 8:27 PM, Samisa Abeysinghe <[email protected]> wrote:
> Cannot treat a number param as a number.
>
> Thanks,
> Samisa...
>
> Samisa Abeysinghe
> VP Engineering
> WSO2 Inc.
> http://wso2.com
> http://wso2.org
>
> Thanks,
Samisa...
Samisa Abeysinghe
VP Engineering
WSO2 Inc.
http://wso2.com
http://wso2.org
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev