Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
extrame committed Jun 12, 2017
1 parent 79987c0 commit 3daf1f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

[![GoDoc](https://godoc.org/github.com/extrame/xls?status.svg)](https://godoc.org/github.com/extrame/xls)

Pure Golang xls library writen by [MinkTech(chinese)](http://www.mink-tech.com).
Pure Golang xls library writen by [Rongshu Tech(chinese)](http://www.rongshu.tech).

Thanks for contributions from Tamás Gulácsi.
Thanks for contributions from Tamás Gulácsi, sergeilem.

**English User please mailto** [Liu Ming](mailto:liuming@mink-tech.com)
**English User please mailto** [Liu Ming](mailto:liuming@rongshu.tech)

This is a xls library writen in pure Golang. Almostly it is translated from the libxls library in c.

Expand Down
17 changes: 13 additions & 4 deletions col.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import (
"fmt"
"math"
"strconv"
"time"

"github.com/extrame/goyymmdd"

This comment has been minimized.

Copy link
@igm

igm Jun 15, 2017

this import causes issues, there's no code in the package at this moment

)

//content type
Expand Down Expand Up @@ -49,21 +50,22 @@ func (xf *XfRk) String(wb *WorkBook) string {
if len(wb.Xfs) > idx {
fNo := wb.Xfs[idx].formatNo()
if fNo >= 164 { // user defined format
if fmt := wb.Formats[fNo]; fmt != nil {
if formatter := wb.Formats[fNo]; formatter != nil {
i, f, isFloat := xf.Rk.number()
if !isFloat {
f = float64(i)
}
fmt.Println(formatter.str, "======")
t := timeFromExcelTime(f, wb.dateMode == 1)

return t.Format(time.RFC3339) //TODO it should be international and format as the describled style
return yymmdd.Format(t, formatter.str)
}
// see http://www.openoffice.org/sc/excelfileformat.pdf
} else if 14 <= fNo && fNo <= 17 || fNo == 22 || 27 <= fNo && fNo <= 36 || 50 <= fNo && fNo <= 58 { // jp. date format
i, f, isFloat := xf.Rk.number()
if !isFloat {
f = float64(i)
}
fmt.Println(fNo)
t := timeFromExcelTime(f, wb.dateMode == 1)
return t.Format("2006.01") //TODO it should be international
}
Expand All @@ -85,6 +87,13 @@ func (rk RK) number() (intNum int64, floatNum float64, isFloat bool) {
}
return
}
//+++ add lines from here
if multiplied != 0 {
isFloat = true
floatNum = float64(val) / 100
return
}
//+++end
return int64(val), 0, false
}

Expand Down

0 comments on commit 3daf1f6

Please sign in to comment.