Skip to content
小飞侠
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
菜单

博客

  1. 首页>
  2. 其他>
  3. String类型数字始终保留两位小数

String类型数字始终保留两位小数

  • Post author:xfxia
  • Post published:2023年8月25日
  • Post category:其他


public static void main(String[] args) {
       DecimalFormat format = new DecimalFormat("0.00");
       String abc ="100.456";
       String a = format.format(new BigDecimal(abc));
       System.out.println(a);
   }


你可能也喜欢

深度学习Course2第二周Optimization Algorithms习题整理

求100~200之间的素数(C语言)

pm2基本使用

如何将本地项目与远程仓库git连接

SDUT-1180 C语言实验——单词统计

spring-data-mongodb 和spring 版本不兼容导致的错误

互斥锁 (mutex)

WEB安全测试要点总结

(原创)RadioButton设置setChecked(true)的异常

通过stream流统计数据(多种方式)

Android开发笔记:RecyclerView(二)刷新与点击事件

2020.10.12–PS–制作图章、抽出滤镜、消失点

使用Memory Analyzer分析内存溢出问题(分析hprof文件)

Git可视化极简易教程 — Git GUI使用方法

VMWare centOS虚拟机黑屏

NBMA实验报告

P1006 [NOIP2008 提高组] 传纸条

OpenSchema 方法

目标检测和语义分割常用的数据增强(代码)

RabbitMQ非root用户安装

目录

  • APICloud (3)
  • golang (228)
  • java (8,236)
  • linux (4,002)
  • mysql (2,800)
  • php (1,070)
  • python (5,439)
  • solidity (25)
  • uniapp (235)
  • vue (2,463)
  • 其他 (88,233)
  • 小程序 (801)

文章归档

  • 2023年十二月 (1872)
  • 2023年十一月 (477)
  • 2023年十月 (17371)
  • 2023年九月 (44974)
  • 2023年八月 (26399)
  • 2023年七月 (14793)
  • 2023年六月 (1)
  • 2023年五月 (2186)
  • 2023年四月 (3838)
  • 2023年三月 (1544)
  • 2023年二月 (3)
  • 2023年一月 (4)
  • 2022年十二月 (3)
  • 2022年十一月 (36)
  • 2022年十月 (16)
  • 2022年九月 (8)
  • 2021年九月 (1)
  • 2020年九月 (6)
  • 2020年八月 (5)

标签

Aave (1) cosmos (6) defi (255) flag (27) gitee (1) github (1) golang (234) java (8234) linux命令 (82) List (1) map (1115) mysql (3093) npm (237) tendermint (6) uuid (43) vant (64) vmware (270) 区块链 (63) 合约 (37) 小程序版本更新 (3)
  • 首页
  • 小程序
  • uniapp
  • vue
  • APICloud
  • 其他
Copyright xfxia.com 鲁ICP备19024253号-2
关闭菜单