Fix floating points with underscores

This commit is contained in:
Thomas Pelletier
2015-09-09 17:17:08 +01:00
parent da703daafe
commit 5753e884d0
3 changed files with 20 additions and 2 deletions
+2 -1
View File
@@ -231,7 +231,8 @@ func (p *tomlParser) parseRvalue() interface{} {
}
return val
case tokenFloat:
val, err := strconv.ParseFloat(tok.val, 64)
cleanedVal := strings.Replace(tok.val, "_", "", -1)
val, err := strconv.ParseFloat(cleanedVal, 64)
if err != nil {
p.raiseError(tok, "%s", err)
}