带空格的JSF convertNumber模式 [英] JSF convertNumber Pattern with whitespaces

查看:74
本文介绍了带空格的JSF convertNumber模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示一个这样的BigInteger: 11111 22222 33333。

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? :-/

谢谢!

推荐答案

< f:convertNumber> 用于 BigInteger DecimalFormat API。正如您在其 javadoc 中所看到的那样,空格不能识别为图案字符。有效模式字符是 0 -等。

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.


  • 我需要转换h:outputtext

  • <一个href = https://stackoverflow.com/questions/16687407/decimalformat-is-being-overridden-by-server-settings/> DecimalFormat被服务器设置覆盖

  • I need to convert h:outputtext
  • DecimalFormat is being overridden by server settings

这篇关于带空格的JSF convertNumber模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆