Skip to content

Commit

Permalink
increase default float number digits from 10 to 16, fix #78
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Mar 12, 2022
1 parent 485ea29 commit 9ab040a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions savejson.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
% opt can have the following fields (first in [.|.] is the default)
%
% FileName [''|string]: a file name to save the output JSON data
% FloatFormat ['%.10g'|string]: format to show each numeric element
% FloatFormat ['%.16g'|string]: format to show each numeric element
% of a 1D/2D array;
% IntFormat ['%.0f'|string]: format to display integer elements
% of a 1D/2D array;
Expand Down Expand Up @@ -152,7 +152,7 @@
opt.compressarraysize=jsonopt('CompressArraySize',100,opt);
opt.compressstringsize=jsonopt('CompressStringSize',opt.compressarraysize*4,opt);
opt.intformat=jsonopt('IntFormat','%.0f',opt);
opt.floatformat=jsonopt('FloatFormat','%.10g',opt);
opt.floatformat=jsonopt('FloatFormat','%.16g',opt);
opt.unpackhex=jsonopt('UnpackHex',1,opt);
opt.arraytostruct=jsonopt('ArrayToStruct',0,opt);
opt.parselogical=jsonopt('ParseLogical',0,opt);
Expand Down

0 comments on commit 9ab040a

Please sign in to comment.