20
0

Cleaned some comments

This commit is contained in:
sergeilem 2019-03-05 22:31:15 +03:00
parent e0f5c1d7ce
commit 61d5335b56
2 changed files with 6 additions and 17 deletions

View File

@ -2,17 +2,9 @@
[![GoDoc](https://godoc.org/github.com/extrame/xls?status.svg)](https://godoc.org/github.com/extrame/xls)
Pure Golang xls library writen by [Rongshu Tech(chinese)](http://www.rongshu.tech).
Pure Golang xls library writen by [Rongshu Tech (chinese)](http://www.rongshu.tech), based on libxls.
Thanks for contributions from Tamás Gulácsi, sergeilem.
**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.
The master brunch has just the reading function without the format.
***new_formater** branch is for better format for date and number ,but just under test, you can try it in development environment. If you have some problem about the output format, tell me the problem, I will try to fix it.*
Thanks for contributions from Tamás Gulácsi.
# Basic Usage
@ -20,5 +12,4 @@ The master brunch has just the reading function without the format.
* Use **OpenWithCloser** function for open file and use the return value closer for close file
* Use **OpenReader** function for open xls from a reader, you should close related file in your own code
* Follow the example in GODOC
* Follow the example in GoDoc

6
col.go
View File

@ -54,10 +54,10 @@ func (xf *XfRk) String(wb *WorkBook) string {
fNo := wb.Xfs[idx].formatNo()
if fNo >= 164 { // user defined format
if formatter := wb.Formats[fNo]; formatter != nil {
if (strings.Contains(formatter.str, "#") || strings.Contains(formatter.str, ".00")){
if strings.Contains(formatter.str, "#") || strings.Contains(formatter.str, ".00") {
//If format contains # or .00 then this is a number
return xf.Rk.String()
}else{
} else {
i, f, isFloat := xf.Rk.number()
if !isFloat {
f = float64(i)
@ -94,13 +94,11 @@ 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
}