extrame / xls

Pure Golang xls library
Apache License 2.0
331 stars 210 forks source link

Cant read integer numbers #27

Closed sergeilem closed 7 years ago

sergeilem commented 7 years ago

There is an error in col.go, func (rk RK) number() (intNum int64, floatNum float64, isFloat bool). Last return must be "return int64(val), 0, false", otherwise function always returns 0 if number stored in cell is integer.

func (rk RK) number() (intNum int64, floatNum float64, isFloat bool) { multiplied := rk & 1 isInt := rk & 2 val := rk >> 2 if isInt == 0 { isFloat = true floatNum = math.Float64frombits(uint64(val) << 34) if multiplied != 0 { floatNum = floatNum / 100 } return } if multiplied !=0 { isFloat = true floatNum = float64(val)/100 return } return int64(val), 0, false }

extrame commented 7 years ago

sorry, I don't know which part should be fixed. Your code is same with last commit version. could you give me a merge request or mask the changed lines ?

sergeilem commented 7 years ago

Sorry, i posted it by mistake. Your code is ok.