Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 9245 invoked by uid 98); 12 Jan 2003 17:53:31 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 9225 invoked from network); 12 Jan 2003 17:53:29 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 12 Jan 2003 17:53:29 -0000 Received: (qmail 56252 invoked by uid 500); 12 Jan 2003 17:52:06 -0000 Received: (qmail 56236 invoked from network); 12 Jan 2003 17:52:05 -0000 Received: from smtp.terra.es (HELO tsmtp2.mail.isp) (213.4.129.129) by daedalus.apache.org with SMTP; 12 Jan 2003 17:52:05 -0000 Received: from terra.es ([217.126.50.211]) by tsmtp2.mail.isp (terra.es) with ESMTP id H8M4AU01.F20 for ; Sun, 12 Jan 2003 18:52:06 +0100 Message-ID: <3E21AB63.30C483C9@terra.es> Date: Sun, 12 Jan 2003 18:52:35 +0100 From: xavi caballe X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: commons-user@jakarta.apache.org Subject: problem with LocaleBeanUtils.copyProperties() Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hello, I have a problem with the locale-dependent version of BeanUtils. I have 2 beans, OrigBean and DestBean. OrigBean has a property named price (with corresponding getter and setter) whose type is String. DestBean has a property named price (with corresponding getter and setter) whose type is Double. Then I have the following code: OrigBean orig = new OrigBean(); // "," IS THE DECIMAL SYMBOL IN SPANISH (my locale) orig.setPrice("123,54"); DestBean dest = new DestBean(); try { LocaleBeanUtils.copyProperties(dest, orig); } catch (Exception e) { System.out.println(e.getMessage()); } System.out.println("dest.price:" + dest.getPrice()); System.out.println(java.util.Locale.getDefault()); java.text.NumberFormat df = java.text.DecimalFormat.getInstance(); System.out.println(((java.text.DecimalFormat)df).getDecimalFormatSymbols().getDecimalSeparator()); and I get the following output: dest.price:0.0 es_ES , Why? I should get "123.54", shouldn't I? Am I doing something wrong? I would appreciate your help. Thanks in advance. Xavi