Name
<fmt:parseNumber>
Synopsis
The <fmt:parseNumber>
action parses
a
number formatted according to locale-specific rules. A custom pattern
can be specified or a locale specific default pattern for a certain
number type (currency, percentage, or a regular number) can be used.
The locale used is the one explicitly specified or is taken from the
locale configuration setting or the locale from the localization
context setting. If none of these are set, the locale is determined
as the best match for the user preferences
(Accept-Language
request header).
Syntax 1: Without a body
<fmt:parseNumber value="number
" [pattern="pattern
" | type="number|currency|percent"] [parseLocale="locale
"] [integerOnly="true|false"] [var="var
" [scope="page|request|session|application"]] />
Syntax 1: With a body
<fmt:formatNumber [pattern="pattern
" | type="number|currency|percent"] [parseLocale="locale
"] [integerOnly="true|false"] [var="var
" [scope="page|request|session|application"]]>number
</fmt:parseNumber>
Attributes
Attribute name |
Java type |
Dynamic value accepted |
Description |
---|---|---|---|
value |
String |
Yes |
The value to parse. |
pattern |
String |
Yes |
A custom pattern in the form accepted by
|
type |
|
Yes |
The name of one of the predefined locale-dependent patterns. |
parseLocale |
|
Yes |
A locale to be used instead of the default. |
integerOnly |
|
Yes |
Set to |
var |
|
No |
The variable ... |
Get JavaServer Pages, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.