diff --git a/core/src/main/java/app/module/core/config/application/util/DailyUtil.java b/core/src/main/java/app/module/core/config/application/util/DailyUtil.java index 259b1f20..c45216f9 100644 --- a/core/src/main/java/app/module/core/config/application/util/DailyUtil.java +++ b/core/src/main/java/app/module/core/config/application/util/DailyUtil.java @@ -1,8 +1,11 @@ package app.module.core.config.application.util; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; +import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.Date; @@ -10,6 +13,7 @@ import java.util.Locale; @Slf4j @Component +@RequiredArgsConstructor public class DailyUtil { /** @@ -103,4 +107,25 @@ public class DailyUtil { return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate)); } + + /** + * 문자형 타입의 숫자에 콤마 적용 + * + * @param value 입력 데이터 + * @return 숫자(콤마, 도트) + */ + public String getStringComma(String value) { + if (StringUtils.isBlank(value)) { + return value; + } + + String[] values = value.split("\\."); + if (values.length > 1) { + Double input = Double.parseDouble(values[0]); + + return new DecimalFormat("###,###").format(input) + "." + values[1]; + } + + return value; + } } diff --git a/front/src/main/resources/templates/record/daily/done.html b/front/src/main/resources/templates/record/daily/done.html index 2860b5b4..21ecb7f5 100644 --- a/front/src/main/resources/templates/record/daily/done.html +++ b/front/src/main/resources/templates/record/daily/done.html @@ -91,7 +91,7 @@
[[${child.itemName}]]
[[${child.workName}]] - 총 [[${child.totalHour}]]시간 + 총 [[${@dailyUtil.getStringComma(child.totalHour)}]]시간 @@ -109,9 +109,9 @@[[${child.equipmentName}]]
총8시간 + th:text="|총 ${@dailyUtil.getStringComma(child.ownedHours)}시간|">총8시간 총8시간 + th:text="|총 ${@dailyUtil.getStringComma(child.leasedHours)}시간|">총8시간수량
- 500g + 500g현금
diff --git a/front/src/main/resources/templates/record/farming/index.html b/front/src/main/resources/templates/record/farming/index.html index 3fc11289..3e272f2e 100644 --- a/front/src/main/resources/templates/record/farming/index.html +++ b/front/src/main/resources/templates/record/farming/index.html @@ -86,7 +86,7 @@수량
- 500g + 500g현물평가액
diff --git a/front/src/main/resources/templates/record/forestry/index.html b/front/src/main/resources/templates/record/forestry/index.html index bcbfca63..494b0b5d 100644 --- a/front/src/main/resources/templates/record/forestry/index.html +++ b/front/src/main/resources/templates/record/forestry/index.html @@ -78,7 +78,7 @@수량
- 500g + 500g현물평가액
diff --git a/front/src/main/resources/templates/record/income/index.html b/front/src/main/resources/templates/record/income/index.html index 6eb848bd..b1b76628 100644 --- a/front/src/main/resources/templates/record/income/index.html +++ b/front/src/main/resources/templates/record/income/index.html @@ -96,7 +96,7 @@수량
- 500g + 500g현금
diff --git a/front/src/main/resources/templates/record/power/index.html b/front/src/main/resources/templates/record/power/index.html index ad89449b..102e80c8 100644 --- a/front/src/main/resources/templates/record/power/index.html +++ b/front/src/main/resources/templates/record/power/index.html @@ -68,11 +68,11 @@자가 사용시간
- 0시간 + 0시간임차 사용시간
- 0시간 + 0시간작업 면적
- +수확량
- +경영주 노동투입시간
- +배우자 노동투입시간
- +가족노동(남)
- +가족노동(여)
- +고용노동(남)
- +고용노동(여)
- +품앗이(남)
- +품앗이(여)
- +일손돕기(남)
- +일손돕기(여)
- +