reporting: @series: add align_right option

time-shift
Houtan Bastani 2013-04-03 16:28:17 +02:00
parent b7786bf4bb
commit 3efe8b5232
2 changed files with 9 additions and 0 deletions

View File

@ -48,6 +48,8 @@ o.table_markers = false;
o.table_neg_color = 'red';
o.table_pos_color = 'blue';
o.table_align_right = false;
if nargin == 1
assert(isa(varargin{1}, 'series'),['@series.series: with one arg you ' ...
'must pass a series object']);

View File

@ -42,13 +42,20 @@ assert(ischar(o.color), '@series.write: color must be a string');
assert(ischar(o.table_neg_color), '@series.write: table_neg_color must be a string');
assert(ischar(o.table_pos_color), '@series.write: table_pos_color must be a string');
assert(islogical(o.table_markers), '@series.write: table_markers must be a string');
assert(islogical(o.table_align_right), '@series.write: table_align_right must be a string');
%% Write Output
dataString = ['%.' num2str(precision) 'f'];
precision = 10^precision;
fprintf(fid, '%% Table Row (series)\n');
if o.table_align_right
fprintf(fid, '\\multicolumn{1}{r}{');
end
fprintf(fid, '%s', o.data.name{:});
if o.table_align_right
fprintf(fid, '}');
end
data = o.data(dates);
data = data.data;
for i=1:size(data,1)