Requested by Sureeraya Limpaibul
This commit is contained in:
parent
678a9117ff
commit
593b413282
|
@ -1,18 +1,15 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
* The contents of this file are subject to the Compiere License Version 1.1
|
||||
* ("License"); You may not use this file except in compliance with the License
|
||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
||||
* the specific language governing rights and limitations under the License.
|
||||
* The Original Code is Compiere ERP & CRM Business Solution
|
||||
* The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
|
||||
* Portions created by Jorg Janke are Copyright (C) 1999-2005 Jorg Janke, parts
|
||||
* created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
*****************************************************************************/
|
||||
package org.compiere.util;
|
||||
|
||||
|
@ -20,30 +17,27 @@ package org.compiere.util;
|
|||
/**
|
||||
* Amount in Words for Thai
|
||||
*
|
||||
* @author Sureeraya Limpaibul - http://www.rgagnon.com/javadetails/java-0426.html
|
||||
* @version $Id: AmtInWords_TH.java,v 1.3 2006/07/30 00:54:35 jjanke Exp $
|
||||
* @author Sureeraya Limpaibul - http://www.rgagnon.com/javadetails/java-0426.h
|
||||
tml
|
||||
* @version $Id: AmtInWords_TH.java,v 1.2 2005/04/19 04:43:31 jjanke Exp $
|
||||
*/
|
||||
public class AmtInWords_TH implements AmtInWords
|
||||
{
|
||||
|
||||
/**
|
||||
* AmtInWords_TH
|
||||
*
|
||||
* 0.23 = <EFBFBD>ٹ<EFBFBD><EFBFBD> 23/100
|
||||
* 1.23 = ˹<EFBFBD>觺ҷ 23/100
|
||||
* 11.45 = <EFBFBD>Ժ<EFBFBD><EFBFBD>紺ҷ 45/100
|
||||
* 121.45 = ˹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD>紺ҷ 45/100
|
||||
* 1231.56 = ˹<EFBFBD>觾ѹ<EFBFBD>ͧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD>紺ҷ 56/100
|
||||
* 12341.78 = ˹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͧ<EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD>紺ҷ 78/100
|
||||
* 123451.89 = ˹<EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ͧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD>紺ҷ 89/100
|
||||
* 12234571.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FBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD>紺ҷ 90/100
|
||||
* 23,123,123,234,571.90 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҹ ˹<EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ͧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~ѹ˹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҹ <EFBFBD>ͧ<EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD><EFBFBD>紺ҷ 90/100
|
||||
* 100,000,000,000,000.90 = ˹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҹ<EFBFBD><EFBFBD>ҹ <EFBFBD>ҷ 90/100
|
||||
* 0.00 = <EFBFBD>ٹ<EFBFBD><EFBFBD> 00/100
|
||||
* 0.23 = \u0e28\u0e39\u0e19\u0e22\u0e4c 23/100
|
||||
* 1.23 = \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e1a\u0e32\u0e17 23/100
|
||||
* 11.45 = \u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14\u0e1a\u0e32\u0e17 45/100
|
||||
* 121.45 = \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e23\u0e49\u0e2d\u0e22\u0e22\u0e35\u0e48\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14\u0e1a\u0e32\u0e17 45/100
|
||||
* 1231.56 = \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e1e\u0e31\u0e19\u0e2a\u0e2d\u0e07\u0e23\u0e49\u0e2d\u0e22\u0e2a\u0e32\u0e21\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14\u0e1a\u0e32\u0e17 56/100
|
||||
* 12341.78 = \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e2b\u0e21\u0e37\u0e48\u0e19\u0e2a\u0e2d\u0e07\u0e1e\u0e31\u0e19\u0e2a\u0e32\u0e21\u0e23\u0e49\u0e2d\u0e22\u0e2a\u0e35\u0e48\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14\u0e1a\u0e32\u0e17 78/100
|
||||
* 123451.89 = \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e41\u0e2a\u0e19\u0e2a\u0e2d\u0e07\u0e2b\u0e21\u0e37\u0e48\u0e19\u0e2a\u0e32\u0e21\u0e1e\u0e31\u0e19\u0e2a\u0e35\u0e48\u0e23\u0e49\u0e2d\u0e22\u0e2b\u0e49\u0e32\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14\u0e1a\u0e32\u0e17 89/100
|
||||
* 12234571.90 = \u0e2a\u0e34\u0e1a\u0e2a\u0e2d\u0e07\u0e25\u0e49\u0e32\u0e19 \u0e2a\u0e2d\u0e07\u0e41\u0e2a\u0e19\u0e2a\u0e32\u0e21\u0e2b\u0e21\u0e37\u0e48\u0e19\u0e2a\u0e35\u0e48\u0e1e\u0e31\u0e19\u0e2b\u0e49\u0e32\u0e23\u0e49\u0e2d\u0e22\u0e40\u0e08\u0e47\u0e14\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14\u0e1a\u0e32\u0e17 90/100
|
||||
* 123234571.90 = \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e23\u0e49\u0e2d\u0e22\u0e22\u0e35\u0e48\u0e2a\u0e34\u0e1a\u0e2a\u0e32\u0e21\u0e25\u0e49\u0e32\u0e19 \u0e2a\u0e2d\u0e07\u0e41\u0e2a\u0e19\u0e2a\u0e32\u0e21\u0e2b\u0e21\u0e37\u0e48\u0e19\u0e2a\u0e35\u0e48\u0e1e\u0e31\u0e19\u0e2b\u0e49\u0e32\u0e23\u0e49\u0e2d\u0e22\u0e40\u0e08\u0e47\u0e14\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14\u0e1a\u0e32\u0e17 90/100
|
||||
* 1987234571.90 = \u0e2b\u0e19\u0e36\u0e48\u0e07\u0e1e\u0e31\u0e19\u0e40\u0e01\u0e49\u0e32\u0e23\u0e49\u0e2d\u0e22\u0e41\u0e1b\u0e14\u0e2a\u0e34\u0e1a\u0e40\u0e08\u0e47\u0e14\u0e25\u0e49\u0e32\u0e19 \u0e2a\u0e2d\u0e07\u0e41\u0e2a\u0e19\u0e2a\u0e32\u0e21\u0e2b\u0e21\u0e37\u0e48\u0e19\u0e2a\u0e35\u0e48\u0e1e\u0e31\u0e19\u0e2b\u0e49\u0e32\u0e23\u0e49\u0e2d\u0e22\u0e40\u0e08\u0e47\u0e14\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14\u0e1a\u0e32\u0e17 90/100
|
||||
* 0.00 = \u0e28\u0e39\u0e19\u0e22\u0e4c 00/100
|
||||
*
|
||||
*/
|
||||
public AmtInWords_TH ()
|
||||
|
@ -146,18 +140,20 @@ public class AmtInWords_TH implements AmtInWords
|
|||
/**
|
||||
* Convert Less Than One Thousand
|
||||
* @param number
|
||||
* @return amt
|
||||
* @return
|
||||
*/
|
||||
private String convertLessThanOneMillion (int number)
|
||||
{
|
||||
String soFar;
|
||||
String soFar = new String();
|
||||
// Esta dentro de los 1os. diecinueve?? ISCAP
|
||||
if (number % 100 < 20)
|
||||
System.out.println("[convertLessThanOneMillion] number = " + number);
|
||||
/* if (number % 100 < 20)
|
||||
{
|
||||
soFar = numNames[(number % 100)];
|
||||
number /= 100;
|
||||
}
|
||||
else
|
||||
*/
|
||||
if (number != 0)
|
||||
{
|
||||
soFar = numNames[number % 10];
|
||||
if (number != 1 && soFar.equals("\u0e2b\u0e19\u0e36\u0e48\u0e07")) {
|
||||
|
@ -181,18 +177,18 @@ public class AmtInWords_TH implements AmtInWords
|
|||
number /= 10;
|
||||
|
||||
}
|
||||
if (number == 0)
|
||||
return soFar;
|
||||
|
||||
if (number == 0) {
|
||||
return soFar;
|
||||
}
|
||||
return numNames[number] + "\u0e23\u0e49\u0e2d\u0e22\u0e25\u0e49\u0e32\u0e19" + soFar;
|
||||
} // convertLessThanOneThousand
|
||||
|
||||
/**
|
||||
* Convert
|
||||
* @param number
|
||||
* @return amt
|
||||
* @return
|
||||
*/
|
||||
private String convert (double number)
|
||||
private String convert (int number)
|
||||
{
|
||||
/* special case */
|
||||
if (number == 0)
|
||||
|
@ -200,7 +196,8 @@ public class AmtInWords_TH implements AmtInWords
|
|||
return "\u0e28\u0e39\u0e19\u0e22\u0e4c";
|
||||
}
|
||||
String prefix = "";
|
||||
String subfix = "\u0e1a\u0e32\u0e17";
|
||||
// \u0e1a\u0e32\u0e17
|
||||
// String subfix = "\u0e1a\u0e32\u0e17";
|
||||
|
||||
if (number < 0)
|
||||
{
|
||||
|
@ -224,15 +221,16 @@ public class AmtInWords_TH implements AmtInWords
|
|||
number /= 1000000d;
|
||||
} while (number > 0);
|
||||
|
||||
return (prefix + soFar + subfix).trim ();
|
||||
return (prefix + soFar).trim ();
|
||||
// return (prefix + soFar + subfix).trim ();
|
||||
} // convert
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
/***********************************************************************
|
||||
***
|
||||
* Get Amount in Words
|
||||
* @param amount numeric amount (352.80)
|
||||
* @return amount in words (three*five*two 80/100)
|
||||
* @throws Exception
|
||||
*/
|
||||
public String getAmtInWords (String amount) throws Exception
|
||||
{
|
||||
|
@ -240,23 +238,95 @@ public class AmtInWords_TH implements AmtInWords
|
|||
return amount;
|
||||
//
|
||||
StringBuffer sb = new StringBuffer ();
|
||||
double pos = (double)amount.lastIndexOf ('.');
|
||||
double pos2 = (double)amount.lastIndexOf (',');
|
||||
int pos = amount.lastIndexOf ('.');
|
||||
int pos2 = amount.lastIndexOf (',');
|
||||
if (pos2 > pos)
|
||||
pos = pos2;
|
||||
String oldamt = amount;
|
||||
amount = amount.replaceAll (",", "");
|
||||
int newpos = amount.lastIndexOf ('.');
|
||||
double pesos = Double.parseDouble (amount.substring (0, newpos));
|
||||
sb.append (convert (pesos));
|
||||
for (int i = 0; i < oldamt.length (); i++)
|
||||
{
|
||||
if (pos == i) // we are done
|
||||
{
|
||||
String cents = oldamt.substring (i + 1);
|
||||
sb.append (' ').append (cents).append ("/100");
|
||||
break;
|
||||
if (newpos != -1) {
|
||||
int pesos = Integer.parseInt(amount.substring(0, newpos));
|
||||
System.out.println(pesos);
|
||||
sb.append(convert(pesos)).append("\u0e1a\u0e32\u0e17");
|
||||
for (int i = 0; i < oldamt.length(); i++) {
|
||||
if (pos == i) { // we are done
|
||||
String cents = oldamt.substring(i + 1);
|
||||
int stang = Integer.parseInt(cents);
|
||||
if (stang != 0) {
|
||||
sb.append(convert(stang)).append("\u0e2a\u0e15\u0e32\u0e07\u0e04\u0e4c");
|
||||
} else {
|
||||
sb.append("\u0e16\u0e49\u0e27\u0e19");
|
||||
}
|
||||
// sb.append (' ').append (cents).append ("/100");
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int pesos = Integer.parseInt(amount);
|
||||
sb.append(convert(pesos)).append("\u0e1a\u0e32\u0e17").append("\u0e16\u0e49\u0e27\u0e19");
|
||||
}
|
||||
return sb.toString ();
|
||||
} // getAmtInWords
|
||||
|
||||
/***********************************************************************
|
||||
***
|
||||
* Get Amount in Words
|
||||
* @param amount numeric amount (352.80)
|
||||
* @return amount in words (three*five*two 80/100)
|
||||
*/
|
||||
public String getAmtInWords (String amount, String iso) throws Exception
|
||||
{
|
||||
if (amount == null)
|
||||
return amount;
|
||||
//
|
||||
StringBuffer sb = new StringBuffer ();
|
||||
int pos = amount.lastIndexOf ('.');
|
||||
int pos2 = amount.lastIndexOf (',');
|
||||
if (pos2 > pos)
|
||||
pos = pos2;
|
||||
String oldamt = amount;
|
||||
amount = amount.replaceAll (",", "");
|
||||
int newpos = amount.lastIndexOf ('.');
|
||||
if (newpos != -1) {
|
||||
int pesos = Integer.parseInt(amount.substring(0, newpos));
|
||||
System.out.println(pesos);
|
||||
if (iso.equals("THB")) {
|
||||
sb.append(convert(pesos)).append("\u0e1a\u0e32\u0e17");
|
||||
for (int i = 0; i < oldamt.length(); i++) {
|
||||
if (pos == i) { // we are done
|
||||
String cents = oldamt.substring(i + 1);
|
||||
int stang = Integer.parseInt(cents);
|
||||
if (stang != 0) {
|
||||
sb.append(convert(stang)).append("\u0e2a\u0e15\u0e32\u0e07\u0e04\u0e4c");
|
||||
} else {
|
||||
sb.append("\u0e16\u0e49\u0e27\u0e19");
|
||||
}
|
||||
// sb.append (' ').append (cents).append ("/100");
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sb.append(convert(pesos)).append("\u0e40\u0e2b\u0e23\u0e35\u0e22\u0e0d");
|
||||
for (int i = 0; i < oldamt.length(); i++) {
|
||||
if (pos == i) { // we are done
|
||||
String cents = oldamt.substring(i + 1);
|
||||
int stang = Integer.parseInt(cents);
|
||||
if (stang != 0) {
|
||||
sb.append(convert(stang)).append("\u0e40\u0e0b\u0e47\u0e19\u0e15\u0e4c").append( " [" +iso +"]");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int pesos = Integer.parseInt(amount);
|
||||
if (iso.equals("THB")) {
|
||||
sb.append(convert(pesos)).append("\u0e1a\u0e32\u0e17").
|
||||
append("\u0e16\u0e49\u0e27\u0e19");
|
||||
} else {
|
||||
sb.append(convert(pesos)).append("\u0e40\u0e2b\u0e23\u0e35\u0e22\u0e0d").append( " [" +iso +"]");
|
||||
}
|
||||
}
|
||||
return sb.toString ();
|
||||
} // getAmtInWords
|
||||
|
@ -276,6 +346,21 @@ public class AmtInWords_TH implements AmtInWords
|
|||
e.printStackTrace();
|
||||
}
|
||||
} // print
|
||||
/**
|
||||
* Test Print
|
||||
* @param amt amount
|
||||
*/
|
||||
private void print (String amt, String currency)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.out.println(amt + " = " + getAmtInWords(amt));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
} // print
|
||||
|
||||
/**
|
||||
* Test
|
||||
|
@ -285,22 +370,22 @@ public class AmtInWords_TH implements AmtInWords
|
|||
{
|
||||
AmtInWords_TH aiw = new AmtInWords_TH();
|
||||
// aiw.print (".23"); Error
|
||||
aiw.print ("0.23");
|
||||
aiw.print ("1.23");
|
||||
aiw.print ("11.45");
|
||||
aiw.print ("121.45");
|
||||
aiw.print ("1231.56");
|
||||
aiw.print ("12341.78");
|
||||
aiw.print ("123451.89");
|
||||
aiw.print ("12234571.90");
|
||||
aiw.print ("123234571.90");
|
||||
aiw.print ("1987234571.90");
|
||||
aiw.print ("11123234571.90");
|
||||
aiw.print ("123123234571.90");
|
||||
aiw.print ("2123123234571.90");
|
||||
aiw.print ("23,123,123,234,571.90");
|
||||
aiw.print ("100,000,000,000,000.90");
|
||||
aiw.print ("0.00");
|
||||
// aiw.print ("0.23");
|
||||
// aiw.print ("1.23");
|
||||
// aiw.print ("11.45");
|
||||
// aiw.print ("121.45");
|
||||
aiw.print ("3,026.00");
|
||||
aiw.print ("65341.78");
|
||||
// aiw.print ("123451.89");
|
||||
// aiw.print ("12234571.90");
|
||||
// aiw.print ("123234571.90");
|
||||
// aiw.print ("1,987,234,571.90");
|
||||
// aiw.print ("11123234571.90");
|
||||
// aiw.print ("123123234571.90");
|
||||
// aiw.print ("2123123234571.90");
|
||||
// aiw.print ("23,123,123,234,571.90");
|
||||
// aiw.print ("100,000,000,000,000.90");
|
||||
// aiw.print ("0.00");
|
||||
} // main
|
||||
|
||||
} // AmtInWords_TH
|
||||
|
|
Loading…
Reference in New Issue