mac
2024-05-17 88fa5aa9631b263e6e3d99d9ee787f73e78c6fda
app/src/main/java/com/hdl/photovoltaic/other/HdlDeviceLogic.java
@@ -82,30 +82,7 @@
    private List<DeviceBean> mListDevice = new ArrayList<>();
    public static String getConvertDoubleUnit(String value) {
        if (TextUtils.isEmpty(value)) {
            return noValue + kWh;
        }
        BigDecimal formattedValue = getBigDecimal(value);
        return formattedValue + kWh;
    }
    public static String getConvertDoubleUnit(int value) {
        if (value == 0) {
            return noValue + kWh;
        }
        BigDecimal formattedValue = getBigDecimal(value + "");
        return formattedValue + kWh;
    }
    private static BigDecimal getBigDecimal(String value) {
        if (TextUtils.isEmpty(value)) {
            return new BigDecimal(0);
        }
        double doubleValue = Double.parseDouble(value);
        return BigDecimal.valueOf(doubleValue).setScale(2, RoundingMode.HALF_UP);
    }
    public void clearDeviceList() {
        if (mListDevice == null) {