Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xuri
excelize
提交
b4ffa8ce
excelize
项目概览
xuri
/
excelize
通知
13
Star
2
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
excelize
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
已验证
提交
b4ffa8ce
编写于
10月 18, 2017
作者:
xurime
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- Add unsigned integer data type support, related issue #136;
- go test and godoc updated Signed-off-by:
Ri Xu
<
xuri.me@gmail.com
>
上级
9b5b74d4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
9 deletion
+29
-9
cell.go
cell.go
+15
-0
excelize_test.go
excelize_test.go
+14
-9
未找到文件。
cell.go
浏览文件 @
b4ffa8ce
...
...
@@ -30,6 +30,11 @@ func (f *File) mergeCellsParser(xlsx *xlsxWorksheet, axis string) string {
// int16
// int32
// int64
// uint
// uint8
// uint16
// uint32
// uint64
// float32
// float64
// string
...
...
@@ -51,6 +56,16 @@ func (f *File) SetCellValue(sheet, axis string, value interface{}) {
f
.
SetCellInt
(
sheet
,
axis
,
int
(
value
.
(
int32
)))
case
int64
:
f
.
SetCellInt
(
sheet
,
axis
,
int
(
value
.
(
int64
)))
case
uint
:
f
.
SetCellInt
(
sheet
,
axis
,
int
(
value
.
(
uint
)))
case
uint8
:
f
.
SetCellInt
(
sheet
,
axis
,
int
(
value
.
(
uint8
)))
case
uint16
:
f
.
SetCellInt
(
sheet
,
axis
,
int
(
value
.
(
uint16
)))
case
uint32
:
f
.
SetCellInt
(
sheet
,
axis
,
int
(
value
.
(
uint32
)))
case
uint64
:
f
.
SetCellInt
(
sheet
,
axis
,
int
(
value
.
(
uint64
)))
case
float32
:
f
.
SetCellDefault
(
sheet
,
axis
,
strconv
.
FormatFloat
(
float64
(
value
.
(
float32
)),
'f'
,
-
1
,
32
))
case
float64
:
...
...
excelize_test.go
浏览文件 @
b4ffa8ce
...
...
@@ -67,16 +67,21 @@ func TestOpenFile(t *testing.T) {
xlsx
.
SetCellValue
(
"Sheet2"
,
"F1"
,
" Hello"
)
xlsx
.
SetCellValue
(
"Sheet2"
,
"G1"
,
[]
byte
(
"World"
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F2"
,
42
)
xlsx
.
SetCellValue
(
"Sheet2"
,
"F2"
,
int8
(
42
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F2"
,
int16
(
42
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F2"
,
int32
(
42
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F2"
,
int64
(
42
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F2"
,
float32
(
42.65418
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F2"
,
float64
(
-
42.65418
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F2"
,
float32
(
42
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F2"
,
float64
(
42
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F3"
,
int8
(
1
<<
8
/
2
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F4"
,
int16
(
1
<<
16
/
2
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F5"
,
int32
(
1
<<
32
/
2
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F6"
,
int64
(
1
<<
32
/
2
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F7"
,
float32
(
42.65418
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F8"
,
float64
(
-
42.65418
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F9"
,
float32
(
42
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F10"
,
float64
(
42
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F11"
,
uint
(
1
<<
32
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F12"
,
uint8
(
1
<<
8
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F13"
,
uint16
(
1
<<
16
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F14"
,
uint32
(
1
<<
32
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F15"
,
uint64
(
1
<<
32
-
1
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"F16"
,
true
)
xlsx
.
SetCellValue
(
"Sheet2"
,
"G2"
,
nil
)
xlsx
.
SetCellValue
(
"Sheet2"
,
"G3"
,
uint8
(
8
))
xlsx
.
SetCellValue
(
"Sheet2"
,
"G4"
,
time
.
Now
())
// Test completion column.
xlsx
.
SetCellValue
(
"Sheet2"
,
"M2"
,
nil
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录