cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KSG1
New Member

Decimal places for a number sent to email using Power Automate/Flow

Hello,

 

First off, I am a total newbie with this kind of thing, I'm working on a simple menu ordering system based on an MS Form, Excel, 2 emails and a Sharepoint list which stores the final data.

 

So, the Customer completes the form, power automate gets the response details, adds a row into an Excel table, Excel calculates the order total which is then grabbed using Compose and passed to an e-mail.

1.png

 

2.png

After some faffing around I have it working except for one thing.... When I pass the order total figure to the e-mail which will be sent to the customer, the figure is being cut to one decimal place if it ends with a zero, for example 17.25 displays fine in the e-mail body, but 17.10 displays as 17.1.

 

3.png

 

How do I correct this and force 2 decimal places so that zeros are displayed? Am I missing something really obvious (probably)?

 

Thanks in advance for your responses

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @KSG1,

 

You could use a formatnumber function. With this you specify the format you want.

 

In your setup you could add this expression to the body:

 

 

formatNumber(float(outputs('Compose')?['Amount Total (Ex VAT)']), '0,0.00')

 

 

View solution in original post

4 REPLIES 4
Expiscornovus
Dual Super User
Dual Super User

Hi @KSG1,

 

You could use a formatnumber function. With this you specify the format you want.

 

In your setup you could add this expression to the body:

 

 

formatNumber(float(outputs('Compose')?['Amount Total (Ex VAT)']), '0,0.00')

 

 

KSG1
New Member

Hi Expiscornovus, thank you thank you, that worked! Fantastic!

Expiscornovus
Dual Super User
Dual Super User

Hi @KSG1,

 

Btw, if you want to go a step further you could even use a currency format, like C2. This format will use two decimals and include the currency symbol as well 😁

 

 

formatNumber(float(outputs('Compose')?['Amount Total (Ex VAT)']), 'C2')

 

 

KSG1
New Member

Great I'll add that in, thanks again!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,568)