From d566a0f10925d764a879cb4ad2c528bff319db99 Mon Sep 17 00:00:00 2001 From: trifonnt Date: Thu, 19 Feb 2009 08:32:35 +0000 Subject: [PATCH] BF: [ 2613760 ] Correction for check printing in French http://sourceforge.net/tracker/?func=detail&atid=883808&aid=2613760&group_id=176962 The amount in words does not works in the previous version with the European numeric displaying.(blank instead comma) --- base/src/org/compiere/util/AmtInWords_FR.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/base/src/org/compiere/util/AmtInWords_FR.java b/base/src/org/compiere/util/AmtInWords_FR.java index 6a35a943ed..e9159c6ed8 100644 --- a/base/src/org/compiere/util/AmtInWords_FR.java +++ b/base/src/org/compiere/util/AmtInWords_FR.java @@ -202,8 +202,21 @@ public class AmtInWords_FR implements AmtInWords pos = pos2; String oldamt = amount; amount = amount.replaceAll (",", ""); - int newpos = amount.lastIndexOf ('.'); - int pesos = Integer.parseInt (amount.substring (0, newpos)); + + String amttobetranslate = amount.substring (0, (pos)); + + // Here we clean unexpected space in the amount + String finalamount = new String(); + char[] mychararray = amttobetranslate.toCharArray(); + for (int i = 0; i < amttobetranslate.length (); i++) + { + if ( !Character.isSpaceChar(mychararray[i])) + { + finalamount = finalamount.concat(String.valueOf(mychararray[i])); + } + } + + int pesos = Integer.parseInt (finalamount); sb.append (convert (pesos)); for (int i = 0; i < oldamt.length (); i++) {