summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-10-12 00:06:09 +0800
committerxuri <xuri.me@gmail.com>2022-10-12 00:06:09 +0800
commit0e657c887bf505d62ce3bf685c518cd0ed7bc558 (patch)
treed0dce47211b4375430795a9d1d4abba5735b4359 /styles.go
parentc02346bafc6e098406f32ee0a183d45f3038c619 (diff)
This closes #1368, fixes number parsing issue, adds support for create a 3D line chart
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/styles.go b/styles.go
index 6d90a9e..5299fbd 100644
--- a/styles.go
+++ b/styles.go
@@ -873,6 +873,9 @@ var operatorType = map[string]string{
// format as string type by given built-in number formats code and cell
// string.
func formatToInt(v, format string, date1904 bool) string {
+ if strings.Contains(v, "_") {
+ return v
+ }
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -884,6 +887,9 @@ func formatToInt(v, format string, date1904 bool) string {
// format as string type by given built-in number formats code and cell
// string.
func formatToFloat(v, format string, date1904 bool) string {
+ if strings.Contains(v, "_") {
+ return v
+ }
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -894,6 +900,9 @@ func formatToFloat(v, format string, date1904 bool) 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, format string, date1904 bool) string {
+ if strings.Contains(v, "_") {
+ return v
+ }
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -907,6 +916,9 @@ func formatToA(v, format string, date1904 bool) 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, format string, date1904 bool) string {
+ if strings.Contains(v, "_") {
+ return v
+ }
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -920,6 +932,9 @@ func formatToB(v, format string, date1904 bool) 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, format string, date1904 bool) string {
+ if strings.Contains(v, "_") {
+ return v
+ }
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -930,6 +945,9 @@ func formatToC(v, format string, date1904 bool) 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, format string, date1904 bool) string {
+ if strings.Contains(v, "_") {
+ return v
+ }
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v
@@ -940,6 +958,9 @@ func formatToD(v, format string, date1904 bool) 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, format string, date1904 bool) string {
+ if strings.Contains(v, "_") {
+ return v
+ }
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return v