Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to add thousands separated (,) format in Textbox with int data type

(1) ShareShare
ReportReport
Posted on by 187
Hi,
 
I have int field data type in table as I don't need dcimal points value, I have to show on a form header. It is working fine. I need to formate (,) as thousands separater. 
 
Please suggest which extended data type I can use or there some other solution for it.
 
I know I can do this by change the type to Real and use extended data type "AmountMST", but I don't want to change the data type.
 
 
Thanks.
 
  • Ariba Mehdi Profile Picture
    Ariba Mehdi 160 on at
    How to add thousands separated (,) format in Textbox with int data type
    Override the field control method formatStr and use the format: #,0;(#,0) to get 1000 separator. 



    Try this:

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,370 Most Valuable Professional on at
    How to add thousands separated (,) format in Textbox with int data type
    Moved from Dynamics AX forum.
     
    Are you sure that you want to format this single integer field in a different way than all other integers in the system?
     
    If you mean that you want to format it as a real number, but without decimal numbers, you can - use a real edit control and set No Of Decimals properties. Usually you shouldn't hard-code details of the format (such as ThousandSeparator); it should come from each user's regional settings. By the way, ThousandSeparator is a property of real controls, not integer controls.
     
    If you want to store the number as int in database and display is as a real, you can use a display (or edit) method.
  • nbhatti2001 Profile Picture
    nbhatti2001 187 on at
    How to add thousands separated (,) format in Textbox with int data type
    Thanks Ariba,
    For the corection, I need thousands separator. I try to find it in field property on form but failed. Here is the property list screen shot from my VM. I have sort the properties alphabatically. I have trid with the table field property as well. I am using D365FO VM.
     
     
  • Martin Dráb Profile Picture
    Martin Dráb 230,370 Most Valuable Professional on at
    How to add comma separated format in Textbox with int data type
    An integer is a number, such as 5 or 999. It's a single value, not a list of values that need to be delimited. Therefore I have no idea why you're saying that you need to formate it comma separated. Please give us more information about your requirements.
  • Ariba Mehdi Profile Picture
    Ariba Mehdi 160 on at
    How to add comma separated format in Textbox with int data type
    Hi there,

    I think you mean to use 1000 separator on the form field value like, 2000 -> 2,000.
     
    Navigate to the field control on the form and change the property ThousandSeparator = Comma.
     


    Hope it helps!

     

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans