How to change integer format

8 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)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!