The number
converter uses the formatting and parsing methods and formats of the java.text.DecimalFormat
class. For example, to truncate any decimals in a number, use number="#"
. To display a number using comma as a grouping separator, and with up to two decimal places, use number="###,###.##"
. To ensure that exactly two decimal places are displayed, even if the decimal digits are zero, use number="#.00"
. See the API reference for java.text.DecimalFormat
in your JSDK for full details about how the converter parses strings into numbers and formats numbers for display.
The following example displays a number with two decimal places and at least one digit before the decimal point (even if any of the digits is zero):
<dsp:valueof bean="CurrentPitcher.earnedRunAverage"
number="0.00"></dsp:valueof>