Effacer les filtres
Effacer les filtres

How to add zero infront of number

1 vue (au cours des 30 derniers jours)
Muhammad Haziq
Muhammad Haziq le 1 Mar 2019
Hi,
I have to add 0 before a number let say num = 2. I want to show as num=02

Réponse acceptée

Honglei Chen
Honglei Chen le 1 Mar 2019
I don't think you can pad zero for a numeric number but you can do it when printing. For example
fprintf('num = %02d\n',2)
Is this what you want? HTH

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by