json-fortran icon indicating copy to clipboard operation
json-fortran copied to clipboard

Rounding a real when printing

Open stoudamire87 opened this issue 2 years ago • 1 comments

Hi Jacob et al.

First of all, thanks for your job.

I would like to know if it possible to round a real number when printing to avoid the round off error in real numbers, since compact_real only trim 0s.

An example can be the output file of test2:

"VARIABLE": "Vz", "UNITS": "km/s", "FRAME": "J2000", "CENTER": "EARTH", "DATA": [ 0.30000000000000001E-2, 0.29999999999999999E-1, 0.40000000000000001E-1 ]

Best regards

stoudamire87 avatar Nov 25 '22 12:11 stoudamire87

The real_format options gives you some control.

jacobwilliams avatar Dec 20 '22 03:12 jacobwilliams