function zps = zeroPadStr(x, fin_length)
%takes as input an integer x and returns a string which is the integer
%zero-padded in front to be length "fin_length"
if length(x)>fin_length
    display(['you are not using zeropad str the right way, it adds zeros, NOT subtracts them!'])
    zps=0;
    return
end
x_str=num2str(x);
zro='0';
if length(x_str)==fin_length
    zps=x_str;
else
    for i=1:fin_length-length(x_str)
        x_str=[zro,x_str];
    end;
end;
zps=x_str;
