MATLAB: How do i round to two decimals without zeros at the end

rounding

Hi I just want to keed 2 decimal places without those zeros shown at the picture what do I do please I tried round

Best Answer

I think this might do what you want
fprintf('Dog detected at second %0.2f\n',idx(:))