I don't like the way f:convertNumber
display NaN ( "\�"
) and both of the infinities ( "\∞"
).
Is there a way to extend the out-of-the-box converter in order to inject my own display logic? Thank you.
To do this:
Override the getAsString method by explicitly handling your special values, and deferring to super
for all others. Pseudocode:
getAsString(FacesContext ctx, UIComponent component, Object value) { if (value is NaN) { return your-own-NaN-string; } if (value is infinity) { return your-own-infinity-string; } return super.getAsNumber(ctx, component, value); }
f:convertNumber
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.