Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

What is the easiest way to get string with leading zero ?

(1) ShareShare
ReportReport
Posted on by 312
Hi guys,
 
Anyone know what is the easiest way to get a string with leading zero, if the number smaller than format length ?
For example, I want to have string in 4 digit /XXXX/, so when my number is 21 it will be /0021/, 6 then will be /0006/.
 
Thanks.
  • Verified answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 10,770 Super User 2024 Season 2 on at
    What is the easiest way to get string with leading zero ?
    Hi @Teevo,
     
    you must use strRFix
     
    strRFix(int2str(Value),4,'0');
    Best regards,
    Mohamed Amine MAHMOUDI

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,759 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,468 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans