Tobago Demo

Menu

Root Dummy Intro Search Getting Started Docker What's New Migration Compatibility FAQ API Download Server Info Logging Info In Suggest Textarea Date Range Group 5 Star Rating File Upload Out Label Badge Image Figure Progress Object Checkbox Toggle Dropdown Radio Listbox SelectOneList Multi Checkbox Multi Listbox Shuttle SelectManyList Button and Link Default Command Button Group Customizer Link Group Box Panel Separator Section Header and Footer Bar Popup Popover Toast Basic example Tab Client Tab Ajax Tab Server Basic example Sheet Sorting Paginator Sheet Column Selector Sheet Selectionchange Sheet Event Sheet Action Sheet Markup Sheet Style Empty Sheet Column Bar Sheet Filter Sheet Static Header Sheet Multi Header Sheet Tree Column Panel Sheet Editable Sheet Lazy Sheet Nested Basic example Tree Command Types Tree Select Tree Editor Tree Menu Tree Listbox Intro TinyMCE CKEditor Flow Layout Flex Layout Segment Layout Label Layout Grid Layout Split Layout Message-layout Overview Collapsible Box Collapsible Popup Collapsible Panel Collapsible Section Content Validation JSR 303 Severity Messages Content Security Policy Sanitize Roles Form AccessKey Focus Exception Handler Style Tag Bootstrap Theme Icons Partial Ajax Behavior WebSocket Transition Non Faces Request Conversion Error Handling For Each ConversationScoped Download Configuration Format Locale DataAttribute Meta
Root Dummy Intro Search Getting Started Docker What's New Migration Compatibility FAQ API Download Server Info Logging Info In Suggest Textarea Date Range Group 5 Star Rating File Upload Out Label Badge Image Figure Progress Object Checkbox Toggle Dropdown Radio Listbox SelectOneList Multi Checkbox Multi Listbox Shuttle SelectManyList Button and Link Default Command Button Group Customizer Link Group Box Panel Separator Section Header and Footer Bar Popup Popover Toast Basic example Tab Client Tab Ajax Tab Server Basic example Sheet Sorting Paginator Sheet Column Selector Sheet Selectionchange Sheet Event Sheet Action Sheet Markup Sheet Style Empty Sheet Column Bar Sheet Filter Sheet Static Header Sheet Multi Header Sheet Tree Column Panel Sheet Editable Sheet Lazy Sheet Nested Basic example Tree Command Types Tree Select Tree Editor Tree Menu Tree Listbox Intro TinyMCE CKEditor Flow Layout Flex Layout Segment Layout Label Layout Grid Layout Split Layout Message-layout Overview Collapsible Box Collapsible Popup Collapsible Panel Collapsible Section Content Validation JSR 303 Severity Messages Content Security Policy Sanitize Roles Form AccessKey Focus Exception Handler Style Tag Bootstrap Theme Icons Partial Ajax Behavior WebSocket Transition Non Faces Request Conversion Error Handling For Each ConversationScoped Download Configuration Format Locale DataAttribute Meta

Conversion

To convert numbers put a <f:convertNumber/> tag in an component.

Example

The following examples show the basic functions of the number converter. The given number is in every example:

Default

By default, grouping is activated and only three digits after the point are shown. Also the value of type is 'number'.

<tc:out label="Number" markup="number" value="#{conversionController.amount}"> <f:convertNumber/> </tc:out> 7,200,000.988

Grouping

Grouping is deactivated.

<f:convertNumber groupingUsed="false"/> 7200000.988

Integer only

Only integer values are shown.

<f:convertNumber integerOnly="true"/> 7,200,000.988

Minimal Digits

There are at minimum 10 integer digits and 5 digits after the point shown. The given amount is not high enough in both ways.

<f:convertNumber minIntegerDigits="10" minFractionDigits="5"/> 0,007,200,000.98760

Maximal Digits

There are maximal 6 integer digits and 2 digits after the point shown. Notice, that the second digit after the point is rounded up.

<f:convertNumber maxIntegerDigits="6" maxFractionDigits="2"/> 200,000.99

Type

The type attribute can have the value 'number' (default), 'currency' and 'percent'. If the type is set to 'currency', a code or a symbol must be set. Have a look at the following examples.

Currency Code

The currency code is set to 'EUR'. Also the type must set to 'currency', otherwise the currencyCode attribute has no effect.

<f:convertNumber type="currency" currencyCode="EUR"/> €7,200,000.99

Currency Symbol

The currency symbol is set to '€'. Also the type must set to 'currency', otherwise the currencyCode attribute has no effect.

<f:convertNumber type="currency" currencySymbol="€"/> €7,200,000.99

Percent

The type is set to 'percent'.

<f:convertNumber type="percent"/> 720,000,099%
© 2005-2025 Apache Software Foundation, Licensed under the Apache License, Version 2.0.