Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Struts2 change negative number to positive number

 
Yogesh Misra
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , I am using this code to displaydata in jsp

<s:property value="bean.prevUnitTests.totalTests"/>

in this code i am getting totalTests value is -10 but i want to show only 10 (Positive value ) , so how we will do it ??
how can we change negative number to positive number

Please help me , Thanks

Yogesh M.
 
Yogesh Misra
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends ,

I got the solution so i am posting here , it will help to some other guys also


<s:property value="bean.prevUnitTests.totalTests * (-1)"/>

with this we can change negative value to positive


Regards,
Yogesh Mishra
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic