Java Utililty Methods Money Convert

List of utility methods to do Money Convert

Description

The list of methods to do Money Convert are organized into topic(s).

Method

intmoney2int(long value)
moneyint
if (value < Integer.MIN_VALUE)
    return Integer.MIN_VALUE;
else if (value > Integer.MAX_VALUE)
    return Integer.MAX_VALUE;
else
    return (int) value;
Stringmoney2str(String money)
moneystr
try {
    return (Double.parseDouble(money) * 100.0D) + "";
} catch (Exception e) {
    System.err.println(e);
return money;
Stringmoney2String(double money)
money String
String[] amounts = (String.format("%.2f", money)).split("\\.");
String amount = "";
for (String a : amounts) {
    amount += a;
return String.format("%012d", Long.valueOf(amount));