안드로이드 샘플코드
[Android] 화폐단위 \ 넣기 + 숫자 세자리마다 쉼표넣기
도넛군
2011. 7. 27. 18:05
//유니코드로 화폐단위 넣기 "\"
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;
}
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;
}