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 ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access