Skip to content

Commit e67d3a3

Browse files
committed
respect integer types
1 parent b5dec91 commit e67d3a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

savejson.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,11 @@
468468
txt='null';
469469
return;
470470
end
471-
floatformat=jsonopt('FloatFormat','%.10g',varargin{:});
471+
if(isinteger(mat))
472+
floatformat=jsonopt('FloatFormat','%d',varargin{:});
473+
else
474+
floatformat=jsonopt('FloatFormat','%.10g',varargin{:});
475+
end
472476
%if(numel(mat)>1)
473477
formatstr=['[' repmat([floatformat ','],1,size(mat,2)-1) [floatformat sprintf('],%s',nl)]];
474478
%else

0 commit comments

Comments
 (0)