Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / Removing decimals from...
Sales forum
Suggested answer

Removing decimals from a number in calculate string field

Posted on by 5

I have a field that needs to show the duration in weeks or years (and specifically mention weeks or years) depending on what it is. So originally I created a string field / calculated that looks like this 

 but the result is this: 

now I don't want the many decimal places and after exhausting a few options of how to format it in a string, I decided to make another field, decimal / calculated - with 2 decimal places and then concat that into the string - 

but for whatever reasoning, the result is the same... with many a decimals. 

Categories:
  • Suggested answer
    Haig Liu Profile Picture
    Haig Liu Microsoft Employee on at
    Removing decimals from a number in calculate string field
    Hi Megan Lisa,
    There is no need to set precision on single-line text fields; it is much simpler to split a calculated field into two parts.
    Please check the following steps:
    1.Because the calculated field cannot set a maximum and minimum value, I set the minimum value of the time field to 0 (I think the time cannot be a negative value).
    2.I store the results of the preliminary calculation in a decimal calculation field with precision set to 0.
    3.Create a single line text calculation field to process the preliminary calculation results obtained in the previous step.
    4.After confirming that it works correctly hide the middle calculation field.
     
     
    Best Regards,
    Haig Liu

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans