To convert currency from number to string format in Java
Here is a code : import java.util.Locale; import java.util.regex.Pattern; /** * CurrencyConverter is used to convert the given amount string into words * * @author Ravi Sharma */ public class CurrencyConverter { /** String array of words for tens Names */ private static final String[] tensNames = { "", "", "TWENTY", "THIRTY", "FORTY", "FIFTY", "SIXTY", "SEVENTY", "EIGHTY", "NINETY" }; /** String array of words for ones Names */ private static final String[] onesNames = { "", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", "ELEVEN", "TWELVE", "THIRTEEN", "FOURTEEN", "FIFTEEN", "SIXTEEN", "SEVENTEEN", "EIGHTEEN", "NINETEEN...