Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

math calculations in JSPs  RSS feed

 
shaf maff
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys

Is it possible to add/subtract/divide/multiply two values in JSP files ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but processing should be done in the page controller prior to forwarding control to a JSP.
 
Keerthi Pandey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, you can do it using javascript..which supports or can perform math operations.

for example:

var creditAmount=parseFloat(document.getElementById("creditMemoAmount").value);
var balanceAmount=parseFloat(creditAmount)-parseFloat(creditApplied);

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!