package com.testor.module.environment.model.dto;

import lombok.Data;

import java.text.DecimalFormat;

@Data
public class HomeEnvironment {
    private String name ;
    private double num ;


    @Override
    public String toString() {
        DecimalFormat decimalFormat = new DecimalFormat("#.##");
        if (num == (int)num) {
            decimalFormat.applyPattern("#");
        }
        return "HomeEnvironment{" +
                "name='" + name + '\'' +
                ", num=" + decimalFormat.format(num) +
                '}';
    }

}
