Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Removing decimals from a number in calculate string field

(0) ShareShare
ReportReport
Posted on by 7

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. 

  • 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

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans