当前位置:网站首页>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);
边栏推荐
- MySQL get time
- Address book (linked list implementation)
- Recommendation number | what are interesting people looking at?
- When using Tencent cloud for the first time, you can only use webshell connection instead of SSH connection.
- What about data leakage? " Watson k'7 moves to eliminate security threats
- Kotlin collaboration uses coroutinecontext to implement the retry logic after a network request fails
- 瑞能实业IPO被终止:年营收4.47亿 曾拟募资3.76亿
- When there are too many input boxes such as input transmitted at one time in the form, the post data is intercepted
- Basic characteristics and isolation level of transactions
- Laravel框架运行报错:No application encryption key has been specified
猜你喜欢
What are the private addresses
Idea remote debugging agent
Kotlin协程利用CoroutineContext实现网络请求失败后重试逻辑
Kotlin collaboration uses coroutinecontext to implement the retry logic after a network request fails
昆仑太科冲刺科创板:年营收1.3亿拟募资5亿 电科太极持股40%
清大科越冲刺科创板:年营收2亿 拟募资7.5亿
uplad_ Labs first three levels
LeetCode_2(两数相加)
laravel-dompdf导出pdf,中文乱码问题解决
RK3566添加LED
随机推荐
Usage, installation and use of TortoiseSVN
Assembly language - Beginner's introduction
Those things I didn't know until I took the postgraduate entrance examination
MySQL if else use case use
嵌入式软件架构设计-消息交互
ZABBIX monitoring
js 从一个数组对象中取key 和value组成一个新的对象
荐号 | 有趣的人都在看什么?
Pancake Bulldog robot V2 (code optimized)
Idea remote debugging agent
【公开课预告】:视频质量评价基础与实践
redis6事务和锁机制
网络安全-HSRP协议
Address book (linked list implementation)
2022 driller (drilling) examination question bank and simulation examination
Solve the problem of "unable to open source file" xx.h "in the custom header file on vs from the source
RK3566添加LED
When there are too many input boxes such as input transmitted at one time in the form, the post data is intercepted
Nantong online communication group
Hide Chinese name