I have declared two float variables for addition purpose...
So, the user can input 2.2+2.2 and get 4.4 And sometimes the user will enter 2+2 and will get 4.0>> this zero needs to be deleted.
I can't use the round method nor converting the whole result into an integer.
My Actual code is here:
holder.txtTotalViews.setText(new StringBuilder().append(new java.text.DecimalFormat("#").format(Float.parseFloat(trendingVideoList.get(position).getTotal_views())/1000)).append("K ").append(activity.getString(R.string.lbl_views)));
I need to calculate total views of video into K format like 10K and 10.5K. I have problem to remove zero from 10.0K.