I am using version '8.3.0.532 (R2014a)'. The sprintf command seems to print out exponential notation when decimal notation is requested (second and third example):
sprintf('%d',1.05*100)sprintf('%d',1.10*100)sprintf('%.0d',1.10*100)ans = 105ans = 1.100000e+02ans = 1e+02
Is there any reason why the last two calls are not printing '110'?
Best Answer