当前位置:网站首页>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);边栏推荐
- [js] basic syntax - for loop
- Solve the problem of invalid uni app configuration page and tabbar
- 昆仑太科冲刺科创板:年营收1.3亿拟募资5亿 电科太极持股40%
- Laravel generate entity
- Basic characteristics and isolation level of transactions
- Laravel框架运行报错:No application encryption key has been specified
- Jetpack compose introduction to mastery
- Idea remote debugging agent
- [public class preview]: basis and practice of video quality evaluation
- asp. Net read TXT file
猜你喜欢

Jasypt configuration file encryption | quick start | actual combat

RK3566添加LED

瑞能实业IPO被终止:年营收4.47亿 曾拟募资3.76亿

laravel-dompdf导出pdf,中文乱码问题解决

明峰医疗冲刺科创板:年营收3.5亿元 拟募资6.24亿

Why do I support bat to dismantle "AI research institute"

These 18 websites can make your page background cool

Recommendation number | what are interesting people looking at?

PHP basic syntax

那些考研后才知道的事
随机推荐
LeetCode_3(无重复字符的最长子串)
搭建一个仪式感点满的网站,并内网穿透发布到公网 2/2
我为什么支持 BAT 拆掉「AI 研究院」
Assembly language - Beginner's introduction
uplad_ Labs first three levels
JS takes key and value from an array object to form a new object
Aspx simple user login
Laravel - model (new model and use model)
matlab学习2022.7.4
Solve the problem of "unable to open source file" xx.h "in the custom header file on vs from the source
redis6事务和锁机制
Redis6 data type and operation summary
French scholars: the explicability of counter attack under optimal transmission theory
Recommendation number | what are interesting people looking at?
【公开课预告】:视频质量评价基础与实践
What is information security? What is included? What is the difference with network security?
Ueditor + PHP enables Alibaba cloud OSS upload
ELK 企业级日志分析系统
LeetCode_69(x 的平方根 )
What happened to the communication industry in the first half of this year?