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 {
80
80
// Prepare format meta data
81
81
func (f * Format ) Prepare () {
82
82
var regexColor = regexp .MustCompile ("^\\ [[a-zA-Z]+\\ ]" )
83
+ var regexSharp = regexp .MustCompile ("^\\ d+\\ .?\\ d?#+" )
83
84
var regexFraction = regexp .MustCompile ("#\\ ,?#*" )
84
85
85
86
for k , v := range f .Raw {
@@ -100,6 +101,11 @@ func (f *Format) Prepare() {
100
101
// strip color information
101
102
v = regexColor .ReplaceAllString (v , "" )
102
103
104
+ // replace 0.0#### as 0.00000
105
+ if regexSharp .MatchString (v ) {
106
+ v = strings .Replace (v , "#" , "0" , - 1 )
107
+ }
108
+
103
109
// Strip #
104
110
v = regexFraction .ReplaceAllString (v , "" )
105
111
@@ -127,7 +133,9 @@ func (f *Format) Prepare() {
127
133
if f .bts > 0 {
128
134
f .bts = f .bts - 1
129
135
}
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 {
131
139
f .bts = - 1
132
140
}
133
141
}
You can’t perform that action at this time.
0 commit comments