Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Format number not working?

(0) ShareShare
ReportReport
Posted on by 4

I am looking at formating a number using the following: 

 formatnumber(float(item()?['Gross Daily']),"[Color 10] 0.00% ▲;[Red] -0.00% ▼")

the formula works fine when I use:

formatnumber(float(item()?['Gross Daily']),'p2')   (to return simply a noncolored percent with 2 decimals)

My format above works in excel perfectly and it appears to meet the correct syntax, yet when I try to place it as an expression Power automate tells me it is invalid.  

 

Any thoughts on where I am making a mistake?

  • grantjenkins Profile Picture
    grantjenkins 11,057 on at
    Re: Format number not working?

    Where are you going to store the output? Will it be Excel or a SharePoint list?

     

    If it's going into a SharePoint list then I'd be outputting just the percentage, and use Column Formatting on the List to add the colors and icons, etc.

  • Expiscornovus Profile Picture
    Expiscornovus 31,081 on at
    Re: Format number not working?

    Hi @Hedgie,

     

    That is the Excel syntax. The formatnumber function in the expression language supports numeric format strings as formats. 

     

    Below are the lists for standard and custom numeric format strings which are supported: 

    https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings

    https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings

     

    What you have used in that format is not listed in those two lists. 

     

    But you might be able to workaround this by using an if function instead.

    if(less(float(item()?['GrossDaily']), 0), concat('Red ', formatnumber(float(item()?['GrossDaily']),'p2'), ' ▼'), concat('Green ', formatnumber(float(item()?['GrossDaily']),'p2'), ' ▲'))

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard