function commaNum(num) { 
    if (num < 0) { num *= -1; var minus = true}
    else var minus = false     
    var dotPos = (num+"").split(".")
    var dotU = dotPos[0]
    var dotD = dotPos[1]
    var commaFlag = dotU.length%3

    if(commaFlag) {
            var out = dotU.substring(0, commaFlag) 
            if (dotU.length > 3) out += ","
    }
    else var out = ""
    for (var i=commaFlag; i < dotU.length; i+=3) {
            out += dotU.substring(i, i+3) 
            if( i < dotU.length-3) out += ","
    }
    if(minus) out = "-" + out
    if(dotD) return out + "." + dotD
    else return out
}

YOUR COMMENT IS THE CRITICAL SUCCESS FACTOR FOR THE QUALITY OF BLOG POST
  1. Топики 2014.02.11 18:17  댓글주소  수정/삭제  댓글쓰기

    정보를 주셔서 감사합니다



//유니코드로 화폐단위 넣기 "\"
amount[i]  = "\uFFE6" + currentpoint( itemDetail.getString("tot") );

==============================================================

//화폐단위 숫자 세자리마다 쉼표넣기
 public String currentpoint(String result){
     DecimalFormat df = new DecimalFormat("#,##0");
     DecimalFormatSymbols dfs = new DecimalFormatSymbols();
     dfs.setGroupingSeparator(',');
     df.setGroupingSize(3);
     df.setDecimalFormatSymbols(dfs);
 
     double inputNum = Double.parseDouble(result);
     result = df.format(inputNum).toString();
     return result;
 }
YOUR COMMENT IS THE CRITICAL SUCCESS FACTOR FOR THE QUALITY OF BLOG POST
  1. 쎄미 2012.09.06 09:32  댓글주소  수정/삭제  댓글쓰기

    고맙습니다 ^^