问题描述
我的号码是 654987.它是数据库中的一个 ID.我想将其转换为字符串.常规的 Double.ToString(value) 使其成为科学形式,6.54987E5.我不想要的东西.
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 I dont want.
我发现的其他格式化函数检查当前语言环境并添加适当的千位分隔符等.由于它是一个 ID,我根本无法接受任何格式.
Other formatting functions Ive found checks the current locale and adds appropriate thousand separators and such. Since its an ID, I cant accept any formatting at all.
怎么做?
澄清:我正在研究一个将所有数字列视为双精度的特殊数据库.Double 是我可以从数据库中检索的唯一(数字)类型.
To clarify: Im working on a special database that treats all numeric columns as doubles. Double is the only (numeric) type I can retrieve from the database.
推荐答案
Use Long:
long id = 654987;
String str = Long.toString(id);
这篇关于Java Double 到 String 的转换,无需格式化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)