Here you go :
<s:property value="getText('{0,number,#,##0.00}',{profit})"/>
This is how I format numbers in my projects. You can use it with <s:if>
to attain what you require.
More Related Contents:
- How to set thousands separator in Java?
- How to print formatted BigDecimal values?
- How to nicely format floating numbers to string without unnecessary decimal 0’s
- Format Float to n decimal places
- How to go about formatting 1200 to 1.2k in java
- How to use java.String.format in Scala?
- How to detect submit button clicked in multiple submit buttons scenario in single Action class? [duplicate]
- Java:Why should we use BigDecimal instead of Double in the real world? [duplicate]
- Struts 2 : There is no Action mapped for namespace [/]
- Adding up BigDecimals using Streams
- Format file size as MB, GB, etc [duplicate]
- Rounding BigDecimal to *always* have two decimal places
- How to do a fractional power on BigDecimal in Java?
- Spring Boot Jackson date and timestamp Format
- Java: unparseable date exception
- Set specific precision of a BigDecimal
- Java BigDecimal trigonometric methods
- How to get the given date string format(pattern) in java?
- How to center a string using String.format?
- Removing trailing zeros from BigDecimal in Java
- Changing parameters after bind in Struts 2
- Is there a way to redirect to another Action class without using on struts.xml
- How to use parameters, request and session objects present in ActionContext?
- BigDecimal adding wrong value
- Java Date Format for Locale
- Struts 2 dynamic variables
- Populating one select menu based on another select menu using AJAX in Struts2
- Avoid duplicate submission of Struts 2 jsp page
- Filter mapping for everything to Struts2 besides one servlet?
- How do I map a BigDecimal in Hibernate so I get back the same scale I put in?