db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From FlorianF...@deuka.de
Subject Antwort: Village
Date Mon, 22 Mar 2004 11:25:46 GMT
There is no error in Village but in your code.
The  DB does return correct values. You tried to convert a decimal value 
to a String and then back to a BigDecimal.

Solution 1: 
Try to get a BigDecimal from the Village record.
Code example:
Record record; 
...
BigDecimal bd = record.getValue(1).asBigDecimal();

Solution 2:
Try to use a java.text.NumberFormatter to retrieve the BigDecimal value.
Here's a code example:
String numberStr = "0,50";
NumberFormatter nf = NumberFormatter.getInstance(Locale.FRANCE);
Number number = nf.parse(strVal);
BigDecimal bd;
if (number instanceof BigDecimal) {
  bd = (BigDecimal) number;
} else {
  bd = new BigDecimal(number.doubleValue());
}


deuka Deutsche Tiernahrung GmbH & Co. KG
Tel.: 0211 / 3034 - 
Fax: 0211 / 3034 - 376
eMail: FlorianFray@deuka.de
WebSite: www.deuka.de
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message