MATLAB Answers

How to change integer format

9 views (last 30 days)
how to make the double value format... like 02 instead of 2 ?

Accepted Answer

Mohammad Abouali
Mohammad Abouali on 29 Dec 2016
Edited: Mohammad Abouali on 29 Dec 2016
fprintf('%0.2d\n',2)
02
fprintf('%0.2d\n',3)
03
fprintf('%0.4d\n',3)
0003

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!