| | |
| | | //装机容量 |
| | | String capacity = mContext.getString(R.string.my_power_station_installed_capacity) + houseIdBean.getInstalledCapacity() + "kW"; |
| | | holder.capacityTv.setText(capacity); |
| | | String kw = "0.0"; |
| | | String kw = "0"; |
| | | try { |
| | | double d = Double.parseDouble(houseIdBean.getPower()); |
| | | int intValue = (int) d; |
| | | if (houseIdBean.getPower().contains(".")) { |
| | | int indexOf = houseIdBean.getPower().indexOf("."); |
| | | houseIdBean.setPower(houseIdBean.getPower().substring(0, indexOf)); |
| | | } |
| | | int intValue = Integer.parseInt(houseIdBean.getPower()); |
| | | int k = intValue / 1000; |
| | | int w = intValue % 1000; |
| | | kw = k + "." + w; |
| | | } catch (Exception ignored) { |
| | | kw = "0.0"; |
| | | } |
| | | //发电功率 |
| | | String power = mContext.getString(R.string.power_station_generated_power) + kw + "kW"; |