Java Double to String conversion without formatting

前端 未结 9 1323
余生分开走
余生分开走 2020-12-06 09:29

I have the number 654987. Its an ID in a database. I want to convert it to a string. The regular Double.ToString(value) makes it into scientific form, 6.54987E5. Something

9条回答
  •  情话喂你
    2020-12-06 09:38

    Also you can use

    double value = getValue();
    
    NumberFormat f = NumberFormat.getInstance();
    f.setGroupingUsed(false);
    
    String strVal = f.format(value);
    

提交回复
热议问题