From 7b53729849c3ae52416b94814af494a1cae7e16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E7=9A=AE?= <14840170+lao-pi123@user.noreply.gitee.com> Date: Wed, 16 Oct 2024 10:19:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=98=9F=E5=B8=81=E6=95=B0=E5=80=BC=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/main/views/MainMeViewHolder.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index 6ff717a41..760c3151a 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -253,12 +253,10 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi } else { coin.setText(coins); } - BigDecimal yuanbao = new BigDecimal(yuanbaos); - String yuanbaoStr = String.valueOf(yuanbao.intValue()); - if (yuanbaoStr.length() > 9) { - star_coin.setText(yuanbaoStr.substring(0, yuanbaoStr.length() - 6) + "M"); - } else if (yuanbaoStr.length() > 7) { - star_coin.setText(yuanbaoStr.substring(0, yuanbaoStr.length() - 3) + "K"); + if (yuanbaos.length() > 9) { + star_coin.setText(yuanbaos.substring(0, yuanbaos.length() - 6) + "M"); + } else if (yuanbaos.length() > 7) { + star_coin.setText(yuanbaos.substring(0, yuanbaos.length() - 3) + "K"); } else { star_coin.setText(yuanbaos); }