728x90
반응형
lombok @Getter, @Setter 어노테이션 제외하고 따로 getter 만들기
@Entity
@DynamicUpdate
@Data
public class entity {
@Column(name = "TOTAL")
private String total;
@Column(name = "SUCCESS")
private String success;
@Column(name = "ERROR")
private String error;
public String getPercentile() {
String percentile = String.format("%.2f", Double.parseDouble(this.success) / Double.parseDouble(this.total)*100.0);
return percentile+"%";
}
}
@Entity
@DynamicUpdate
@Data
public class entity {
@Column(name = "COUNT")
private int count;
@Column(name = "SUCCESS")
private int success;
@Column(name = "ERROR")
private int error;
public String getPercentile() {
String percentile = String.format("%.2f", (double) this.success / (double) this.count *100.0);
return percentile+"%";
}
}
728x90
반응형
'IT > WEB' 카테고리의 다른 글
[WEB] API 간단한 호출 및 JSON 받기 (0) | 2022.08.03 |
---|---|
[Shell Script] 리눅스 서버에 스프링부트 war 실행 (0) | 2022.07.26 |
[Spring boot] 엑셀 다운로드 기능 공통 코드 (0) | 2022.07.13 |
[이클립스] 포맷을 이용해 소스 코드 이쁘게 관리하기 (0) | 2022.07.09 |
[JAVA] 리눅스에서 Jar 파일 실행_쉘 스크립트 (0) | 2022.07.08 |