public static String formatStringUpto2DigitDecimal(String orig) { String newValue = orig.substring(orig.indexOf(".")); if(newValue.length() > 3){ System.out.println("newValue : " + newValue + " New : " + newValue.substring(0,3)); return orig.substring(0,orig.indexOf(".")).concat(newValue.substring(0,3)); } return orig; }
No comments:
Post a Comment