LibreCat / Catmandu

Catmandu - a data processing toolkit
https://librecat.org
177 stars 31 forks source link

set_field omits trailing dots from a literal string with digits #372

Closed netsensei closed 4 years ago

netsensei commented 5 years ago

e.g.

catmandu convert Null to YAML --fix "set_field('foo', '1234.')" will yield:

---
foo: 1234
...

These values do work correctly:

When converting to JSON we get this result:

catmandu convert Null to JSON --fix "set_field('foo', '1234.')" will yield:

[{"foo":1234.0}]

Note how 1234. is converted to 1234.0

Escaping the dot doesn't work:

catmandu convert Null to JSON --fix "set_field('foo', '1234\.')" will yield:

[{"foo":1234\\.}]
nics commented 4 years ago

fixed in 1.2009