I18N Format Tag Library
The JSTL tag provides support for internationalization (i18n), which can display different languages depending on the client domain that makes the request. It also provides a way to format data and dates.
Implementing these features requires the I18N Format Tag library (i18n-capable formation tags liberary). The method for introducing the tag library is:
<%@ taglib prefix= "FMT" uri= "Http://java.sun.com/jsp/jstl/fmt"%>
The I18N Format Tag library provides 11 tags, which can be functionally divided into 3 categories as follows:
(1) Date format of the number. FormatNumber tags, formatdata tags, parsenumber tags, parsedate tags, timezone tags, settimezone tags.
(2) Read the message resource. Bundle label, message label, Setbundle label.
(3) Internationalization. SetLocale label, requestencoding label.
1 Digital Date format
Numeric date format Labels There are 6 of them, used to convert numbers or dates to the format you set.
1.1<frm:formatnumber/> Label
The label is displayed by changing the number to a different format based on a specific area.
"Syntax 1":
<frm:formatnumber value= "formatted data" [type= "Number|currency|percent"]
[pattern= "pattern"]
[currencycode= "Code"
[currencysymbol= "symbol"]
[groupingused= "True|false"]
[maxintergerdigits= "Maxdigits"]
[minintergerdigits= "Mindigits"]
[maxfractiondigits= "Maxdigits"]
[minfractiondigits= "Mindigits"]
[var= ' name ']
[Scope=page|request|session|application]
/>
"Syntax 2":
<frm:formatnumber [type= "Number|currency|percent"]
[pattern= "pattern"]
[currencycode= "code"]
[currencysymbol= "symbol"]
[groupingused= "True|false"]
[maxintergerdigits= "Maxdigits"]
[minintergerdigits= "Mindigits"]
[maxfractiondigits= "Maxdigits"]
[minfractiondigits= "Mindigits"]
[var= ' name ']
[Scope=page|request|session|application]
> Formatted Data <frm:formatNumber>
Attribute Description <fmt:formatNumber> Label parameter description
Name: Description: EL: Type: must: Default value
Value: Data to format: Yes: String: Yes: none
Type: Specifies types (units, currencies, percentages, and so on): yes: No: Number
Pattern: Formatted data style: is: String: No: None
CurrencyCode: Currency Unit code: Yes: No: No
Cuttencysymbol: Currency symbol ($, ¥): is: String: No: None
Groupingused: Whether to group integer parts as (9,999): Yes: Boolean: Yes: True
Maxintergerdigits: Number of digits of the most pairs of integers: yes: int: no: None
Minintergerdigits: Minimum number of digits in the integer section: yes: int: no: None
Maxfractiondigits: The number of decimal parts to display most digits: yes: int: no: None
Minfractiondigits: Minimum number of decimal digits: yes: int: no: None
VAR: Storing formatted data: No: String: No: None
Scope:var's JSP range: No: String: No: Page
Type application of the types attribute
Type: Description: Example
Number: Digital format: 0.8
Currency: Local Currency: ¥0.80
Percent: Percent format: 80%