java - 如何将 2.5E7 更改为正常格式的数字?

标签 java

如何将 2.5E7 更改为 2,500,000.00?

最佳答案

尝试:

DecimalFormat format = new DecimalFormat("#0,0000.00");
String formattedNumber = format.format(number);

See here

如果你想解析 2.5E7 那么你可以这样做

long number = Double.valueOf("2.5E7").longValue();

关于java - 如何将 2.5E7 更改为正常格式的数字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6171823/

相关文章:

java - 检查 GPS 和/或移动网络位置是否已启用

java - 在/* 上映射全局前端 Controller servlet 时如何访问静态资源

java - 为什么要使用模型- View - Controller ?

c# - 字节序、语言、硬件和网络

java.lang.IllegalArgumentException : The attribute [A] from the managed type [T] is not present 异常

java - 自动解决 PMD 违规问题?

java - HashMap 重复值 - 识别重复项

java - Spring MVC - AngularJS - 文件上传 - org.apache.commons.fileupload.FileUploadException

java - 使用 Jni4net 运行 Bridge.LoadAndRegisterAssemblyFrom(File arg0) 时出现 System.IO.FileNotFoundException

Java——使用扫描仪读取十六进制数