List of utility methods to do Money Convert
int | money2int(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; |
String | money2str(String money) moneystr try { return (Double.parseDouble(money) * 100.0D) + ""; } catch (Exception e) { System.err.println(e); return money; |
String | money2String(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)); |