From b3daf1a0f9262a0c1f6d708cbd68ba4ebac779a2 Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Fri, 18 Aug 2017 11:10:25 +0800 Subject: [PATCH] add commaformatter --- format/formatter.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/format/formatter.go b/format/formatter.go index 1eaa926..2e2a759 100644 --- a/format/formatter.go +++ b/format/formatter.go @@ -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 }