summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-04-30 09:54:11 +0800
committerGitHub <noreply@github.com>2022-04-30 09:54:11 +0800
commit856ee57c4019b4478da0f6cb3010ae636914a6be (patch)
treea1a28fb6dec307695d4ec491929a00961c1c65ec /styles.go
parent0f93bd23c97ac0f04fe8012bd4a262c851e44a82 (diff)
This closes #1212, init support for 1900 or 1904 date system
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/styles.go b/styles.go
index 11f6f75..6ef7dcb 100644
--- a/styles.go
+++ b/styles.go
@@ -754,7 +754,7 @@ var currencyNumFmt = map[int]string{
// builtInNumFmtFunc defined the format conversion functions map. Partial format
// code doesn't support currently and will return original string.
-var builtInNumFmtFunc = map[int]func(v string, format string) string{
+var builtInNumFmtFunc = map[int]func(v, format string, date1904 bool) string{
0: format,
1: formatToInt,
2: formatToFloat,
@@ -847,7 +847,7 @@ var criteriaType = map[string]string{
// formatToInt provides a function to convert original string to integer
// format as string type by given built-in number formats code and cell
// string.
-func formatToInt(v string, format string) string {
+func formatToInt(v, format string, date1904 bool) string {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -858,7 +858,7 @@ func formatToInt(v string, format string) string {
// formatToFloat provides a function to convert original string to float
// format as string type by given built-in number formats code and cell
// string.
-func formatToFloat(v string, format string) string {
+func formatToFloat(v, format string, date1904 bool) string {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -868,7 +868,7 @@ func formatToFloat(v string, format string) string {
// formatToA provides a function to convert original string to special format
// as string type by given built-in number formats code and cell string.
-func formatToA(v string, format string) string {
+func formatToA(v, format string, date1904 bool) string {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -883,7 +883,7 @@ func formatToA(v string, format string) string {
// formatToB provides a function to convert original string to special format
// as string type by given built-in number formats code and cell string.
-func formatToB(v string, format string) string {
+func formatToB(v, format string, date1904 bool) string {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -896,7 +896,7 @@ func formatToB(v string, format string) string {
// formatToC provides a function to convert original string to special format
// as string type by given built-in number formats code and cell string.
-func formatToC(v string, format string) string {
+func formatToC(v, format string, date1904 bool) string {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -907,7 +907,7 @@ func formatToC(v string, format string) string {
// formatToD provides a function to convert original string to special format
// as string type by given built-in number formats code and cell string.
-func formatToD(v string, format string) string {
+func formatToD(v, format string, date1904 bool) string {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -918,7 +918,7 @@ func formatToD(v string, format string) string {
// formatToE provides a function to convert original string to special format
// as string type by given built-in number formats code and cell string.
-func formatToE(v string, format string) string {
+func formatToE(v, format string, date1904 bool) string {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v