From 8f16a76781fb8f47094492c38a02c2cdc4ce5013 Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 18 May 2022 23:15:24 +0800 Subject: This fixes a part of staticcheck issues and updates the code of conduct Update example for set cell hyperlinks with `HyperlinkOpts` --- styles.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'styles.go') 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 -- cgit v1.2.1