20
0

add commaformatter

This commit is contained in:
Liu Ming 2017-08-18 11:10:25 +08:00
parent d3f14f70d8
commit b3daf1a0f9

View File

@ -18,7 +18,6 @@ func (f *Formatter) Format(val float64, date1904 bool) string {
itemFormatString, _ := i.translateToGolangFormat()
gf += itemFormatString
}
fmt.Println(f)
if f.typ == DATEFORMAT {
t := TimeFromExcelTime(val, date1904)
return t.Format(gf)
@ -48,6 +47,22 @@ func (self *basicFormatter) String() string {
return fmt.Sprintf("basic formatter as (%s)", self.origin)
}
type commaFormatter struct {
basicFormatter
}
func (self *commaFormatter) translateToGolangFormat() (string, error) {
return self.origin, nil
}
func (self *commaFormatter) setOriginal(o string) {
self.origin = o
}
func (self *commaFormatter) String() string {
return fmt.Sprintf("basic formatter as (%s)", self.origin)
}
type YearFormatter struct {
basicFormatter
}