|
|
@@ -480,7 +480,12 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) *ParseError {
|
|
|
return nil
|
|
|
}
|
|
|
case reflect.Float32, reflect.Float64:
|
|
|
- if f, err := strconv.ParseFloat(tok.value, fv.Type().Bits()); err == nil {
|
|
|
+ v := tok.value
|
|
|
+ if strings.HasSuffix(v, "f") {
|
|
|
+ // Ignore 'f' for compatibility with output generated by C++.
|
|
|
+ v = v[:len(v)-1]
|
|
|
+ }
|
|
|
+ if f, err := strconv.ParseFloat(v, fv.Type().Bits()); err == nil {
|
|
|
fv.SetFloat(f)
|
|
|
return nil
|
|
|
}
|