JSF convertNumber Pattern with whitespaces

2019-08-10 05:03发布

I want to display a BigInteger like this: "11111 22222 33333".

I tried the following, which does not work:

         <f:convertNumber pattern="#00000 00000 00000" />

What am I doing wrong? :-/

Thanks in advance!

标签: jsf converter
1条回答
我只想做你的唯一
2楼-- · 2019-08-10 05:21

The <f:convertNumber> uses for BigInteger the DecimalFormat API under the covers. As you can see in its javadoc, the blank space is not recognized as a pattern character. Valid pattern characters are 0, #, ., -, etc.

You seem to want to ouptut a non-standard format. You'd need to create a custom converter for the job.

See also:

查看更多
登录 后发表回答