cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kmayes
Post Prodigy
Post Prodigy

Format Number Expression

Hi 

 

I have a flow that uses dynamic content in an array, the data comes from a SP list and I need to format the value as the number that comes back is 9.00000000. So I would like to format it so that it just displays the number before the decimal. The dynamic content is within an apply to each I have used the expression:

formatNumber(items('Apply_to_each')?['Column_Name'],'######')
 
Can anyone support on this?
1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Kmayes,

 

You could use the int function instead of the formatNumber function:

int(items('Apply_to_each')?['Column_Name'])

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

4 REPLIES 4
Expiscornovus
Super User
Super User

Hi @Kmayes,

 

You could use the int function instead of the formatNumber function:

int(items('Apply_to_each')?['Column_Name'])

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


CFXtomayur
Regular Visitor

The following expression worked for me.  In this example, I am adding three variables, then formatting the number and coverting into float value to be saved in a float type Variable.

 
float(string(formatNumber(add(variables('CostReg'), add(variables('CostOT'), variables('CostPrOT'))),'00.00')))

anyone have ever found the formatnumber (the FX not the flow component) syntax? 

Expiscornovus
Super User
Super User

Hi @DPozzi,


There is documentation about the formatnumber function:

https://aka.ms/logicexpressions#formatnumber

 

And there is also documentation about the formatters itself:

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



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,518)