当前位置:网站首页>poi设置列的数据格式(有效)
poi设置列的数据格式(有效)
2022-07-05 13:52:00 【热爱Java的编程小白】
直接贴代码讲解,亲试有效!
//设置文本格式
HSSFCellStyle textStyleNum = workbook.createCellStyle();
textStyleNum.setDataFormat(HSSFDataFormat.getBuiltinFormat("@"));
//日期格式
HSSFDataFormat format= workbook.createDataFormat();
textStyleNum.setDataFormat(format.getFormat("yyyy年m月d日"));
//保留两位小数
textStyleNum.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));
//第一参数指设置哪一列,第二参数指HSSFCellStyle 对象
sheet.setDefaultColumnStyle(2, textStyleNum);
边栏推荐
- RK3566添加LED
- -Web direction attack and defense world
- These 18 websites can make your page background cool
- 荐号 | 有趣的人都在看什么?
- 牛客网:拦截导弹
- Matlab learning 2022.7.4
- Laravel - model (new model and use model)
- 通讯录(链表实现)
- Datapipeline was selected into the 2022 digital intelligence atlas and database development report of China Academy of communications and communications
- Attack and defense world crypto WP
猜你喜欢
[cloud resources] what software is good for cloud resource security management? Why?
The development of speech recognition app with uni app is simple and fast.
Deep copy is hard
Scientific running robot pancakeswap clip robot latest detailed tutorial
Anchor navigation demo
Catch all asynchronous artifact completable future
Those things I didn't know until I took the postgraduate entrance examination
国富氢能冲刺科创板:拟募资20亿 应收账款3.6亿超营收
Wonderful express | Tencent cloud database June issue
jasypt配置文件加密|快速入门|实战
随机推荐
Self built shooting range 2022
ETCD数据库源码分析——集群间网络层客户端peerRt
French scholars: the explicability of counter attack under optimal transmission theory
LeetCode_3(无重复字符的最长子串)
这18个网站能让你的页面背景炫酷起来
Linked list (simple)
[server data recovery] a case of RAID5 data recovery stored in a brand of server
Programmer growth Chapter 8: do a good job of testing
Pancake Bulldog robot V2 (code optimized)
[cloud resources] what software is good for cloud resource security management? Why?
Redis6 transaction and locking mechanism
锚点导航小demo
昆仑太科冲刺科创板:年营收1.3亿拟募资5亿 电科太极持股40%
Liar report query collection network PHP source code
How to apply the updated fluent 3.0 to applet development
嵌入式软件架构设计-消息交互
Set up a website with a sense of ceremony, and post it to the public 2/2 through the intranet
几款分布式数据库的对比
redis6主从复制及集群
常见问题之PHP——Fatal error: Allowed memory size of 314572800 bytes exhausted...