package studycave.studycaverestservice.model.test.dto;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.text.DecimalFormat;

@Setter
@AllArgsConstructor
@NoArgsConstructor
public class TestResultResponseDTO {

    @Getter
    private String name;

    @Getter
    private String surname;

    @Getter
    private float userScore;

    private float percent;
    
    public float getPercent(){
        DecimalFormat df = new DecimalFormat();
        df.setMaximumFractionDigits(2);
        return Float.parseFloat(df.format(this.percent));
    }
}
