summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-05-18 23:15:24 +0800
committerxuri <xuri.me@gmail.com>2022-05-18 23:15:24 +0800
commit8f16a76781fb8f47094492c38a02c2cdc4ce5013 (patch)
tree12a9933300ba1f196120e530091e4464e1a6bc35 /styles.go
parentbe5a4033c0c7de6247c02dc3ab76b634ac19d4c6 (diff)
This fixes a part of staticcheck issues and updates the code of conduct
Update example for set cell hyperlinks with `HyperlinkOpts`
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/styles.go b/styles.go
index b7b1525..4b5c772 100644
--- a/styles.go
+++ b/styles.go
@@ -874,11 +874,9 @@ func formatToA(v, format string, date1904 bool) string {
return v
}
if f < 0 {
- t := int(math.Abs(f))
- return fmt.Sprintf("(%d)", t)
+ return fmt.Sprintf("(%d)", int(math.Abs(f)))
}
- t := int(f)
- return fmt.Sprintf("%d", t)
+ return fmt.Sprintf("%d", int(f))
}
// formatToB provides a function to convert original string to special format
@@ -901,8 +899,7 @@ func formatToC(v, format string, date1904 bool) string {
if err != nil {
return v
}
- f *= 100
- return fmt.Sprintf("%.f%%", f)
+ return fmt.Sprintf("%.f%%", f*100)
}
// formatToD provides a function to convert original string to special format
@@ -912,8 +909,7 @@ func formatToD(v, format string, date1904 bool) string {
if err != nil {
return v
}
- f *= 100
- return fmt.Sprintf("%.2f%%", f)
+ return fmt.Sprintf("%.2f%%", f*100)
}
// formatToE provides a function to convert original string to special format