修复我的界面星币数值显示不正确的问题

This commit is contained in:
老皮 2024-10-16 10:19:14 +08:00
parent 95128b64ea
commit 7b53729849

View File

@ -253,12 +253,10 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
} else { } else {
coin.setText(coins); coin.setText(coins);
} }
BigDecimal yuanbao = new BigDecimal(yuanbaos); if (yuanbaos.length() > 9) {
String yuanbaoStr = String.valueOf(yuanbao.intValue()); star_coin.setText(yuanbaos.substring(0, yuanbaos.length() - 6) + "M");
if (yuanbaoStr.length() > 9) { } else if (yuanbaos.length() > 7) {
star_coin.setText(yuanbaoStr.substring(0, yuanbaoStr.length() - 6) + "M"); star_coin.setText(yuanbaos.substring(0, yuanbaos.length() - 3) + "K");
} else if (yuanbaoStr.length() > 7) {
star_coin.setText(yuanbaoStr.substring(0, yuanbaoStr.length() - 3) + "K");
} else { } else {
star_coin.setText(yuanbaos); star_coin.setText(yuanbaos);
} }