web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Integer Data Type that will not remove 0 in beginning

(0) ShareShare
ReportReport
Posted on by

i need to have this Integer or a numerical data type/variable where i will put value with zero in beginning:

example:

int num;

num = 000005;

output: 5

desired output: 000005

i need the 0 in printing and I need it to be integer because i will add value in the 000005

example:

num = 000005 + 1;
output: 6

desired output: 000006

how can i manage to do it in numerical form without removing 0? i cant do STRREM because the number of 0 is not fixed, it can be 2 ZERO or 3 or more ZERO.

please help me. thanks.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at

    As I remember from math classes, such zeros has no meaning, therefore 000005 is 5 as long as we're talking about numbers. And that's the point. You should stop thinking about number and start thinking about text representing formatted numbers.

    You can convert number 5 to text 000005 by calling num2Str0(5, 6).

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans