YouTip LogoYouTip

Jstl Format Parsenumber Tag

# Tag [![Image 3: JSP Standard Tag Library](#)JSP Standard Tag Library](#) The tag is used to parse numbers, percentages, and currencies. ### Syntax Format <fmt:parseNumber value="" type="" pattern="" parseLocale="" integerOnly="" var="" scope=""/> ### Attributes The tag has the following attributes: | **Attribute** | **Description** | **Required** | **Default Value** | | --- | --- | --- | --- | | value | The number to be parsed | No | Body | | type | NUMBER, CURRENCY, or PERCENT | No | number | | parseLocale | The locale used when parsing the number | No | Default locale | | integerOnly | Whether to parse only integer values (true) or floating-point numbers (false) | No | false | | pattern | Custom parsing pattern | No | None | | timeZone | The time zone for displaying the date | No | Default time zone | | var | Variable to store the parsed number | No | Print to page | | scope | Scope of the var attribute | No | page | The pattern attribute has the same function as the pattern in the tag. During parsing, the pattern attribute tells the parser the expected format. * * * ## Example JSTL fmt:parseNumber Tag

Number Parsing:

Number Parsing (1) :

Number Parsing (2) :

The output is as follows: Number Parsing:Number Parsing (1) : 1250003.35Number Parsing (2) : 1250003 * * JSP Standard Tag Library](#)
← Jstl Format Formatdate TagJstl Format Formatnumber Tag β†’