cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mikedumka
Frequent Visitor

Displaying a number as Currency or Decimal

Hello Everyone, 

I am in the process of developing a flow to be used exclusivly in the App, but I need to show a number in a currency or 2 decimal format. All of the solutions I see are for PowerApps using the Text expression. But that does not work in Flow. 

How would I display 300 as $300.00?

Thanks

Mike

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

The following expressions almost does the job:

 

concat('$',div(variables('value'),100),'.',mod(variables('value'),100))

 

this will turn 12345 into $123.45

 

The only time this doesn't work is is the part after the . is less than 10.

12305 would turn into $123.5

 

Thereforee I had to go for the slightly more complicated:

concat('$',div(variables('value'),100),'.',if(less(mod(variables('value'),100),10),concat('0',mod(variables('value'),100)),mod(variables('value'),100)))

 

12305 will now turn into $123.05

 

 

View solution in original post

27 REPLIES 27

Hi Mike,
This isn't really about flow or is it?
I cam understand that you want to display data in a certain way in powerapps,but not sure where you would want to display this in Flow.

Are you trying to sens out an email alert and need to display the sat in a certain way?

Thanks Pieter,

Yeah it is a flow question becuase it has to do with displaying information in the details of the approval I am trying to build. Now that I said that, it would have helped to include that in the original question Man Sad

The idea is that people want to approve or reject an approval directly in the mobile application without having to go anywhere to get more information then come back to take action. Im this workflow it has to do with dollar amounts, I take the value from SharePoint (currency format) and add it to the details of the flow, but it show up with like 5 trailing 0's (10.00000). 

I just can't seem to find an article that explains how to do this in Flow, and not in PowerApps which has the text function. 

Thanks

I need to have a think on this. I could consider using the mod function to get the bit after the 1.
You probably also need the div function and mul function.
It doesn't look straightforward.

I am looking for the same thing, I want to send information in an email and the field is currency type in SharePoint.  And I got it working in the form on powerapps.  But I can't seem to find a way to add the nessisary formatting for it in FLOW.

The following expressions almost does the job:

 

concat('$',div(variables('value'),100),'.',mod(variables('value'),100))

 

this will turn 12345 into $123.45

 

The only time this doesn't work is is the part after the . is less than 10.

12305 would turn into $123.5

 

Thereforee I had to go for the slightly more complicated:

concat('$',div(variables('value'),100),'.',if(less(mod(variables('value'),100),10),concat('0',mod(variables('value'),100)),mod(variables('value'),100)))

 

12305 will now turn into $123.05

 

 

Thanks so much @Pieter_Veenstra That did the trick!

This solution almost entirely solved my problem. I am having one issue. Instead of my currency value coming out properly,  $60.00 looks like $0.6.60. Please see my screen shots below Flow Running SuccessfullyFlow Running SuccessfullyMy variable formulaMy variable formula

@jeffbe2100 , can you publish the concat function that you used?

concat('$',div(variables('vartotalcost'),100),'.',if(less(mod(variables('vartotalcost'),100),10),concat('0',mod(variables('vartotalcost'),100)),mod(variables('vartotalcost'),100)))

Here is the concat I used. I also tested the shorter concat that was suggested as "almost" working early in the thread. It too yeilded the same result. 

I think I've figured out your problem. 

 

Your amount is stored as 12.34 where for this to work it needs to be stored 1234

 

You could simply multiple your variable by 100 to solve the problem.

 

 

Is it possible for you to show what that that concat function would look like with your suggestion? This sort of formula is outside of my realm of understanding and I want to understand which part of the formula i am to add the multplication by 100. 

I wouldn't update the concat as that would make things more coomplicated than needed. 

 

The easier way is to update the varibale ( or create a new variable) and set this to 

 

mul(100, variables('yourvariablename'))
 
You could of course also use a Compose action and set itto the above.

 

I've run multiple tests and keep getting fails. Any further suggestions? I've tried every configuration, but yet to find the correct encantation.

 

Test 1 Build.PNGTest 1 Run.PNGTest 2 Build.PNG

I found another solution to my business needs. If I save the data from the SharePoint currency column into a float variable it comes across fine. 🙂

Anonymous
Not applicable

It leaves out the comma when you reach the thousands. Anyway to fix that?

Can you elaborate on this with any screen shots? I too have a currency problem that i'm running through flow into a variable. When I run the flow as per your suggestion, the outcome of a sharepoint currency column through a currency column turns $50.00 to 50. 





 

tcorcor11
Frequent Visitor

Hey Mike,

 

I am in a similar situation and have been reformatting the data in a SharePoint list/calculated column with Text(CurrencyField, "$#,###" ). The calculated column exports a string output by default (you can change this) which you can pick up in your Flow and inject into the approval step.

 

Once the Flow is finished you can delete the SharePoint item if you want. It feels hacky, i know, but it works very well.

SCTdan
Continued Contributor
Continued Contributor

There's actually a better calculated column option -

DOLLAR([column],2)  

where 2 = number of decimal places you want.  Leave the data type as text.

QpHpRkO

 

@SCTdan best solution, in my opinion. Thanks for the pro tip.

 

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.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,203)