%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
JSTL: Formatting/I18N Support -- Number, Currency, and Percent Example
Formatting Numbers, Currencies, and Percentages
- Format "123456789" as number:
- Format "123456789" as currency (using browser locale):
- Format "123456789" as currency with "EUR" currency
code:
- Format "123456789" as currency (using browser locale), with
grouping turned off, the maximum number of digits in the integer portion
limited to 4, and no fraction portion:
- Format "123456789" as percentage:
123456789
- Format "123456789" as currency (using browser locale):
then parse it back in and print the parsed result:
- Format "12345.67" as US Dollar:
then parse its integer portion only and output the result:
- Format "12345.67" as German currency (given string is
parsed using "en" locale before it is formatted):