• Post Reply Bookmark Topic Watch Topic
  • New Topic

math calculations in JSPs

 
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: 65519
105
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);

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!