mirror of
https://github.com/json-c/json-c.git
synced 2026-04-01 03:19:06 +08:00
PR#394: don't always append the ".0" if the double value rounds to zero because some custom formats *will* include it (e.g. %.2f).
Also try to accomodate formats to explicitly exclude the decimal (e.g. %.0f).
This commit is contained in:
@@ -12,3 +12,7 @@ obj.to_string(with thread format)=T0.52X
|
||||
obj.to_string(long thread format)=Ttttttttttttt0.52xxxxxxxxxxxxxxxxxxX
|
||||
obj.to_string(back to global format)=x0.524y
|
||||
obj.to_string(back to default format)=0.52381
|
||||
obj(12.0).to_string(default format)=12.0
|
||||
obj(12.0).to_string(%.0f)=12
|
||||
obj(12.0).to_string(%.0g)=1e+01
|
||||
obj(12.0).to_string(%.1g)=12.0
|
||||
|
||||
Reference in New Issue
Block a user