How to Avoid Scientific Notation in Double?

前端 未结 5 1477
走了就别回头了
走了就别回头了 2020-11-30 10:23

Here is my simple code

        @Override
    public void onClick(View v) {
        try {
            double price = Double.parseDouble(ePrice.getText().toStr         


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 10:38

    You can try this DecimalFormat

    DecimalFormat decimalFormatter = new DecimalFormat("############");
    number.setText(decimalFormatter.format(Double.parseDouble(result)));
    

提交回复
热议问题