![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FTK5JA%2FbtsCZ86GEzY%2F7feNG3Ew2wTg9WKKHcxVI0%2Fimg.png)
가격 자리 수마다 , (콤마)를 표현할 때 사용하는 함수 fun getDecimalFormatPrice(price: String?): String? { // String용 var result = "0" if (price == null || price.isEmpty()) return result val dfs = DecimalFormatSymbols() dfs.groupingSeparator = ',' val df = DecimalFormat("#,##0") //#대신 0을 주면 무조건 0으로 대체 df.groupingSize = 3 //3자리수 마다 그룹핑 df.decimalFormatSymbols = dfs val dPrice = price.toDouble() result = df.format(dPri..