public static String insertComma(String arg){
int j = 0;
String rtnValue = new String();
for (int i = arg.length() - 1 ; i >= 0; i--){
j++;
rtnValue = arg.charAt(i) + rtnValue;
if(i > 0){
if(j == 3){
rtnValue = "," + rtnValue;
j = 0;
}
}
}
return rtnValue;
}
댓글 없음:
댓글 쓰기