Skip to content

Commit 7a4f89a

Browse files
authored
Merge pull request #163 from Y-edu/hotfix/price_format
fix : 학부모 입금안내시 금액 소수점 미노출되는 문제 수정
2 parents ce23606 + 4fdf85d commit 7a4f89a

File tree

1 file changed

+10
-1
lines changed
  • shared/bizppurio-support/src/main/java/com/yedu/bizppurio/support/application/mapper

1 file changed

+10
-1
lines changed

shared/bizppurio-support/src/main/java/com/yedu/bizppurio/support/application/mapper/BizppurioMapper.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.yedu.common.event.bizppurio.ClassGuideEvent;
1111
import com.yedu.common.event.bizppurio.ParentsClassInfoEvent.ClassTime;
1212
import com.yedu.common.event.bizppurio.ParentsClassInfoEvent.FirstDay;
13+
import java.text.DecimalFormat;
1314
import java.time.DayOfWeek;
1415
import java.time.LocalTime;
1516
import java.time.format.DateTimeFormatter;
@@ -52,6 +53,9 @@ public class BizppurioMapper {
5253
private static final String CHANNEL = "AC";
5354
private static final String MESSAGE = "MD";
5455

56+
57+
private static final DecimalFormat PAY_FORMAT = new DecimalFormat("#.##");
58+
5559
public CommonRequest mapToApplyAgree(ApplyAgreeEvent applyAgreeEvent) {
5660
String message =
5761
("이제 한 단계만 남았어요! \n"
@@ -692,7 +696,7 @@ public CommonRequest mapToPayNotification(PayNotificationEvent event) {
692696
"""
693697
.strip()
694698
.replace("#{name}", event.nickName())
695-
.replace("#{pay}", String.valueOf(event.pay() / 10_000));
699+
.replace("#{pay}", formatPay(event.pay()));
696700

697701
Message messageBody =
698702
new TextMessage(
@@ -702,6 +706,11 @@ public CommonRequest mapToPayNotification(PayNotificationEvent event) {
702706
return createCommonRequest(messageBody, event.parentPhoneNumber());
703707
}
704708

709+
private String formatPay(int amount) {
710+
double pay = amount / 10_000.0;
711+
return PAY_FORMAT.format(pay);
712+
}
713+
705714
public CommonRequest mapToTeacherCompleteTalkChangeNoticeEvent(
706715
TeacherCompleteTalkChangeNoticeEvent event) {
707716

0 commit comments

Comments
 (0)