From c27253af633a92c76c3276a2744bc3cae92a663b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Aragunde=20P=C3=A9rez?= Date: Mon, 28 Nov 2011 18:52:53 +0100 Subject: [PATCH] [Bug #1273] Reimplement coerceToString as a workaround for the bug in Decimalbox. FEA: ItEr75S04BugFixing --- .../java/org/libreplan/web/common/LenientDecimalBox.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/common/LenientDecimalBox.java b/libreplan-webapp/src/main/java/org/libreplan/web/common/LenientDecimalBox.java index 6b3643dbd..1f9a8e0e9 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/common/LenientDecimalBox.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/common/LenientDecimalBox.java @@ -19,15 +19,14 @@ package org.libreplan.web.common; import java.math.BigDecimal; -import java.text.DecimalFormatSymbols; - -import org.zkoss.util.Locales; import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zul.Decimalbox; /** * Same behavior as a {@link Decimalbox}, but it always interprets . as * decimal separator, even when the locale uses a different separator. + * We also reimplement coerceToString to workaround the bug + * http://tracker.zkoss.org/browse/ZK-629. * * @author Óscar González Fernández * @author Jacobo Aragunde Pérez @@ -43,4 +42,8 @@ public class LenientDecimalBox extends Decimalbox { super(value); } + protected String coerceToString(Object value) { + return formatNumber(value, null); + } + }