/**
* 将金额从元转为分 * * @param amtY * String * @return */ public static String formatAmtY2F(String amtY) { if (amtY == null || "".equals(amtY.trim())|| "0".equals(amtY)) return "0"; if (amtY.indexOf(",") != -1) { amtY = amtY.replace(",", ""); } amtY=new DecimalFormat("0.00").format(new BigDecimal(amtY)); int index = amtY.indexOf("."); int len = amtY.length(); StringBuffer amtF = new StringBuffer(); if (index == -1) { amtF.append(amtY).append("00"); } else if ((len - index) == 1) { amtF.append(Long.parseLong(amtY.replace(".", ""))).append("00"); } else if ((len - index) == 2) { amtF.append(Long.parseLong(amtY.replace(".", ""))).append("0"); } else { amtF.append(Long.parseLong(amtY.replace(".", ""))); } return amtF.toString(); }