Jsf-convertnumber-tag
提供:Dev Guides
JSF-f:convertNumber
f:convertNumberタグは、文字列値を必要な形式の数に変換するために使用されます。
JSFタグ
タグ属性
S.No | Attribute & Description |
---|---|
1 |
type 数値(デフォルト)、通貨、またはパーセント |
2 |
pattern java.text.DecimalFormatで定義されているフォーマットパターン |
3 |
maxFractionDigits 小数部の最大桁数 |
4 |
minFractionDigits 小数部の最小桁数 |
5 |
maxIntegerDigits 整数部の最大桁数 |
6 |
minIntegerDigits 整数部の最小桁数 |
7 |
integerOnly 整数部分のみが解析される場合はtrue(デフォルト:false) |
8 |
groupingUsed グループ区切り文字が使用されている場合はtrue(デフォルト:true) |
9 |
locale 解析および書式設定に使用されるプリファレンスのロケール |
10 |
currencyCode 通貨値を変換するときに使用するISO 4217通貨コード |
11 |
currencySymbol 通貨値を変換するときに使用する通貨記号 |
応用例
上記のタグをテストするテストJSFアプリケーションを作成しましょう。
Step | Description |
---|---|
1 | Create a project with a name helloworld under a package com.finddevguides.test as explained in the JSF - First Application chapter. |
2 | Modify home.xhtml as explained below. Keep the rest of the files unchanged. |
3 | Compile and run the application to make sure business logic is working as per the requirements. |
4 | Finally, build the application in the form of war file and deploy it in Apache Tomcat Webserver. |
5 | Launch your web application using appropriate URL as explained below in the last step. |
home.xhtml
すべての変更を完了したら、JSF-最初のアプリケーションの章で行ったようにアプリケーションをコンパイルして実行します。 すべてがアプリケーションで問題ない場合、次の結果が生成されます。