add commaformatter
This commit is contained in:
parent
d3f14f70d8
commit
b3daf1a0f9
@ -18,7 +18,6 @@ func (f *Formatter) Format(val float64, date1904 bool) string {
|
|||||||
itemFormatString, _ := i.translateToGolangFormat()
|
itemFormatString, _ := i.translateToGolangFormat()
|
||||||
gf += itemFormatString
|
gf += itemFormatString
|
||||||
}
|
}
|
||||||
fmt.Println(f)
|
|
||||||
if f.typ == DATEFORMAT {
|
if f.typ == DATEFORMAT {
|
||||||
t := TimeFromExcelTime(val, date1904)
|
t := TimeFromExcelTime(val, date1904)
|
||||||
return t.Format(gf)
|
return t.Format(gf)
|
||||||
@ -48,6 +47,22 @@ func (self *basicFormatter) String() string {
|
|||||||
return fmt.Sprintf("basic formatter as (%s)", self.origin)
|
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 {
|
type YearFormatter struct {
|
||||||
basicFormatter
|
basicFormatter
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user