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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Add zero's prefix in real value with decimal

(0) ShareShare
ReportReport
Posted on by 115

Hi All,

I want to add number of zero's prefix of real field value(Customer balance) like (#00000000000.00) this format.

Ex: customer balance round of 341.75 means I need this value to be this #00000000341.75 format 

 

Any help

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hello baduru,

    Is this issue related to AX2012 or D365FO?

    Asking because you ended up in the 'old' AX2012 forum.

    Best regards,

    Ludwig

  • Suggested answer
    Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    Several approaches are possible. I would use System.String::Format():

    str s = System.String::Format('#{0:00000000000.00}', 341.75);

  • baduru hameed Profile Picture
    115 on at

    Hi Ludwig,

    Thanks for your response

    I am working in D365 FO

  • baduru hameed Profile Picture
    115 on at

    Hi Martin,

    Thanks for your response

    I tried the above code but it's not working as expected for my data entity export activity

    str customerBalance = System.String::Format('#{0:00000000000.00}', custTrans.AmountMST);

    Actual o/p:

    #000000003

    Expected o/p:

    #00000000341.75

    Kindly let me know how can i achieve this format.

    Thanks in advance

  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    Aren't you assigning it to a string variable with StringSize=10? It sounds very likely to me - I guess you're using an EDT with limited string size. after assigning

    By the way, I moved this thread to Dynamics 365 Finance forum.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans