File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ type Format struct {
8080// Prepare format meta data
8181func (f * Format ) Prepare () {
8282 var regexColor = regexp .MustCompile ("^\\ [[a-zA-Z]+\\ ]" )
83+ var regexSharp = regexp .MustCompile ("^\\ d+\\ .?\\ d?#+" )
8384 var regexFraction = regexp .MustCompile ("#\\ ,?#*" )
8485
8586 for k , v := range f .Raw {
@@ -100,6 +101,11 @@ func (f *Format) Prepare() {
100101 // strip color information
101102 v = regexColor .ReplaceAllString (v , "" )
102103
104+ // replace 0.0#### as 0.00000
105+ if regexSharp .MatchString (v ) {
106+ v = strings .Replace (v , "#" , "0" , - 1 )
107+ }
108+
103109 // Strip #
104110 v = regexFraction .ReplaceAllString (v , "" )
105111
@@ -127,7 +133,9 @@ func (f *Format) Prepare() {
127133 if f .bts > 0 {
128134 f .bts = f .bts - 1
129135 }
130- } else if t := strings .Index (f .Raw [0 ], "General" ); t > 0 {
136+ } else if t := strings .Index (f .Raw [0 ], "General" ); - 1 != t {
137+ f .bts = - 1
138+ } else if t := strings .Index (f .Raw [0 ], "@" ); - 1 != t {
131139 f .bts = - 1
132140 }
133141 }
You can’t perform that action at this time.
0 commit comments