Java Double to String conversion without formatting

前端 未结 9 1290
余生分开走
余生分开走 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:58

    What about Long.toString((long)value) ?

    0 讨论(0)
  • 2020-12-06 09:59

    How about String.valueOf((long)value);

    0 讨论(0)
  • 2020-12-06 10:02

    Use Long:

    long id = 654987;
    String str = Long.toString(id);
    
    0 讨论(0)
提交回复
热议问题