web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / MS Flow expression: Ho...
Power Automate
Unanswered

MS Flow expression: How to format calculated SharePoint field to 2 decimal places

(0) ShareShare
ReportReport
Posted on by 358

we have a calculated column in our SharePoint List with the below formula:

 

=TEXT([Contract Value (£)]/(DATEDIF([Contract Start Date],[Contract End Date],"M")/12),"#,###.00")

here are the settings:

Calculated Field Format 3.PNG

 

In the list, it looks correct:

Calculated Field Format 1.PNG

Now in our Flow, we need to update a field in the list with a concatenated string using the below formula:

 

concat('The Annual Contract Value (£',triggerBody()?['AnnualContractValue'],') falls below the £50,000 annual threshold, so Finance & Procurement Approval was skipped')

this is then used in an email, but the value returned by the concatenated formula is incorrect:

Calculated Field Format 5.PNG

 

what we want to see is £1621.62

 

How can we format that currency number returned by the calculated field to 2 decimal places?

Categories:
I have the same question (0)
  • Verified answer
    gamoraes Profile Picture
    1,040 on at
    Re: MS Flow expression: How to format calculated SharePoint field to 2 decimal places

    Hi @livingstonep 

     

    Unfortunately there isn't still an easy way to do this in Flow, however I've made a formula to work around this,

    I show this here, but the formula to 'cut' this extra numbers is above, when the '2' in red are the amount of decimals to keep, and the ',' are the separator

     

     

    substring(triggerBody()?['AnnualContractValue'],0,add(indexof(triggerBody()?['AnnualContractValue'],','),2))

     

    addapted to your code the full expression is

     

    concat('The Annual Contract Value (£',substring(triggerBody()?['AnnualContractValue'],0,add(indexof(triggerBody()?['AnnualContractValue'],','),2)),') falls below the £50,000 annual threshold, so Finance & Procurement Approval was skipped')

     

    If my answer was helpful give me a kudo, if I answered question do not forget to mark as an answer to help the community

     

  • livingstonep Profile Picture
    358 on at
    Re: MS Flow expression: How to format calculated SharePoint field to 2 decimal places

    thanks for your answer, but what do you mean by separator?

     

    concat('The Annual Contract Value (£',substring(triggerBody()?['AnnualContractValue'],0,add(indexof(triggerBody()?['AnnualContractValue'],','),2)),') falls below the £50,000 annual threshold, so Finance & Procurement Approval was skipped')

    surely the sperator in my number is the decimal point ?

     

    thanks for your help with this.

  • efialttes Profile Picture
    14,756 on at
    Re: MS Flow expression: How to format calculated SharePoint field to 2 decimal places

    @livingstonep 

    Let's assume you obtain details of your list item via a Get Item action Block, so the output value of the column is

    body('Get_item')?['YourColumnName']

     

    I guess you don't want to modify the existing formula on your Sharepoint List, right? In such a case, I would suggest to use an WDL function based expression:

     

    lastIndexOf() returns the starting position or index value for the last occurrence of a substring. This function is not case-sensitive, and indexes start with the number 0. You can use '.' as substring:

    lastIndexOf(body('Get_item')?['YourColumnName'],'.')

     

    add(): You can use it to calculate the lenght of the substring you need to extract in order to get the number with two decimals.

    add(lastIndexOf(body('Get_item')?['YourColumnName'],'.'),1)

     

    substring() returns characters from a string, starting from the specified position, or index. Index values start with the number 0. You can use 0 as startIndex, and the length of the substring you need to extract in order to get the number with two decimals.

     

    substring(body('Get_item')?['YourColumnName'],0,

    add(lastIndexOf(body('Get_item')?['YourColumnName'],'.'),1))

     

    Hope this helps

  • gamoraes Profile Picture
    1,040 on at
    Re: MS Flow expression: How to format calculated SharePoint field to 2 decimal places

    Yes! is your decimal point, because in some cultures is '.' and others ','.

     

    The function works?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard