Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
excelize
提交
1bc53020
excelize
项目概览
此号慢热型
/
excelize
与 Fork 源项目一致
Fork自
xuri / excelize
通知
2
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
已验证
提交
1bc53020
编写于
1月 20, 2021
作者:
xurime
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed #764, add a condition for round precision
上级
b260485f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
6 deletion
+9
-6
cell_test.go
cell_test.go
+3
-2
rows.go
rows.go
+3
-1
sheet.go
sheet.go
+3
-3
未找到文件。
cell_test.go
浏览文件 @
1bc53020
...
@@ -124,8 +124,9 @@ func TestSetCellValues(t *testing.T) {
...
@@ -124,8 +124,9 @@ func TestSetCellValues(t *testing.T) {
err
=
f
.
SetCellValue
(
"Sheet1"
,
"A1"
,
time
.
Date
(
1600
,
time
.
December
,
31
,
0
,
0
,
0
,
0
,
time
.
UTC
))
err
=
f
.
SetCellValue
(
"Sheet1"
,
"A1"
,
time
.
Date
(
1600
,
time
.
December
,
31
,
0
,
0
,
0
,
0
,
time
.
UTC
))
assert
.
NoError
(
t
,
err
)
assert
.
NoError
(
t
,
err
)
_
,
err
=
f
.
GetCellValue
(
"Sheet1"
,
"A1"
)
v
,
err
=
f
.
GetCellValue
(
"Sheet1"
,
"A1"
)
assert
.
EqualError
(
t
,
err
,
`strconv.ParseFloat: parsing "1600-12-31T00:00:00Z": invalid syntax`
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
v
,
"1600-12-31T00:00:00Z"
)
}
}
func
TestSetCellBool
(
t
*
testing
.
T
)
{
func
TestSetCellBool
(
t
*
testing
.
T
)
{
...
...
rows.go
浏览文件 @
1bc53020
...
@@ -20,6 +20,7 @@ import (
...
@@ -20,6 +20,7 @@ import (
"log"
"log"
"math"
"math"
"strconv"
"strconv"
"strings"
"github.com/mohae/deepcopy"
"github.com/mohae/deepcopy"
)
)
...
@@ -345,7 +346,8 @@ func (c *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) {
...
@@ -345,7 +346,8 @@ func (c *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) {
}
}
return
f
.
formattedValue
(
c
.
S
,
c
.
V
),
nil
return
f
.
formattedValue
(
c
.
S
,
c
.
V
),
nil
default
:
default
:
if
len
(
c
.
V
)
>
16
{
splited
:=
strings
.
Split
(
c
.
V
,
"."
)
if
len
(
splited
)
==
2
&&
len
(
splited
[
1
])
>
15
{
val
,
err
:=
roundPrecision
(
c
.
V
)
val
,
err
:=
roundPrecision
(
c
.
V
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
sheet.go
浏览文件 @
1bc53020
...
@@ -1137,7 +1137,7 @@ type PageLayoutOptionPtr interface {
...
@@ -1137,7 +1137,7 @@ type PageLayoutOptionPtr interface {
type
(
type
(
// BlackAndWhite specified print black and white.
// BlackAndWhite specified print black and white.
BlackAndWhite
bool
BlackAndWhite
bool
// FirstPageNumber specified first printed page number. If no value is
// FirstPageNumber specified
the
first printed page number. If no value is
// specified, then 'automatic' is assumed.
// specified, then 'automatic' is assumed.
FirstPageNumber
uint
FirstPageNumber
uint
// PageLayoutOrientation defines the orientation of page layout for a
// PageLayoutOrientation defines the orientation of page layout for a
...
@@ -1145,9 +1145,9 @@ type (
...
@@ -1145,9 +1145,9 @@ type (
PageLayoutOrientation
string
PageLayoutOrientation
string
// PageLayoutPaperSize defines the paper size of the worksheet.
// PageLayoutPaperSize defines the paper size of the worksheet.
PageLayoutPaperSize
int
PageLayoutPaperSize
int
// FitToHeight specified number of vertical pages to fit on.
// FitToHeight specified
the
number of vertical pages to fit on.
FitToHeight
int
FitToHeight
int
// FitToWidth specified number of horizontal pages to fit on.
// FitToWidth specified
the
number of horizontal pages to fit on.
FitToWidth
int
FitToWidth
int
// PageLayoutScale defines the print scaling. This attribute is restricted
// PageLayoutScale defines the print scaling. This attribute is restricted
// to values ranging from 10 (10%) to 400 (400%). This setting is
// to values ranging from 10 (10%) to 400 (400%). This setting is
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录