package com.ruoyi.demo.entity.bo;

import lombok.Data;

import java.io.Serializable;

@Data
public class BrandGeoLabelBo implements Serializable {
    private String code;
    private String name;
    private Integer total;
    private String ratio;

    public BrandGeoLabelBo() {
    }

    public BrandGeoLabelBo(String name, Integer total, int count) {
        this.name = name;
        if (total == null) {
            this.total = 0;
            ratio = "0%";
        } else {
            this.total = total;
            float ratio = (float) total / count;
            this.ratio = String.format("%.2f", ratio * 100) + "%";
        }
    }
}
