Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to add thousands s...
Finance forum
Suggested answer

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

Posted on by 154
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 228,501 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 154 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 228,501 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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans