2015-03-19 10:39:41 +01:00
|
|
|
package xls
|
|
|
|
|
2017-07-26 11:56:49 +02:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
formatter "github.com/extrame/xls/format"
|
|
|
|
)
|
|
|
|
|
|
|
|
type format struct {
|
2015-03-25 07:47:26 +01:00
|
|
|
Head struct {
|
|
|
|
Index uint16
|
|
|
|
Size uint16
|
|
|
|
}
|
2015-03-19 10:39:41 +01:00
|
|
|
str string
|
|
|
|
}
|
2017-07-26 11:56:49 +02:00
|
|
|
|
|
|
|
func (f *format) Format(val float64, date1904 bool) string {
|
|
|
|
_, tokens := formatter.Lexer(f.str)
|
|
|
|
ds := formatter.Parse(tokens)
|
|
|
|
fmt.Println("=>", val)
|
|
|
|
return ds.Format(val, date1904)
|
|
|
|
}
|