webtier@glassfish.java.net

Convert String to BigDecimal

From: <webtier_at_javadesktop.org>
Date: Wed, 06 Oct 2010 10:28:20 PDT

Hello,

How should I convert a h:inputText value to a BigDecimal using a comma as a decimal separator?

If I put <f:convertNumber pattern="#,##0.00"/> on the field, a String like 3,68 is converted to a BigDecimal like 3..680000000000000159872115546022541821002960205078125

I think JSF is converting the String to a double before converting to BigDecimal.

I´m using JSF 2 with Glassfish 3.0.1
[Message sent by forum member 'fabriciolemos']

http://forums.java.net/jive/thread.jspa?messageID=484454