cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
drossi
Helper III
Helper III

Always display as two decimal places

Hello,

 

 I have field where a calculation occurs. However, I have an issue with this field and others on my App where it doesn't always display to two decimal places.

 

I use the Round function but it doesn't always work i.e. it will show 14.5 if it is really 14.50 but correctly shows as 15.51.

 

It is for showing a currency so ideally needs to be two decimal places for invoicing.

 

Round((Value(RetarderOil.Text)*3.6)+(Value(DataCardValue34.Text)*4.50)+(Value(DataCardValue24.Text)*3.60)+(Value(DataCardValue26.Text)*3.60)+(Value(DataCardValue29.Text)*4.20)+(Value(DataCardValue25.Text)*2.50)+If(GreaseLorryCheck.Value,10.00,0)+If(ClutchFluidCheck.Value,3.50,0)+If(FillGreaserCheck.Value,25.00,0)+If(ScreenwashCheck.Value,5.00,0),2)

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
timl
Super User III
Super User III

Hi @drossi 

This should format the output to 2 decimal places:

Text(
Round((Value(RetarderOil.Text)*3.6)+(Value(DataCardValue34.Text)*4.50)+(Value(DataCardValue24.Text)*3.60)+(Value(DataCardValue26.Text)*3.60)+(Value(DataCardValue29.Text)*4.20)+(Value(DataCardValue25.Text)*2.50)+If(GreaseLorryCheck.Value,10.00,0)+If(ClutchFluidCheck.Value,3.50,0)+If(FillGreaserCheck.Value,25.00,0)+If(ScreenwashCheck.Value,5.00,0),2),
"#.00"
)

 

View solution in original post

MarvinBangert
Continued Contributor
Continued Contributor

Hi @drossi 

you can use the "Text()" function to specify the text format like:

Text(Value(15.50),"[$-en-US]##.00")

this should show your result as "15.50" instead of "15.5".

You can find more examples over here: Text function - Power Apps | Microsoft Docs

 

Hope this will help you!

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

9 REPLIES 9
timl
Super User III
Super User III

Hi @drossi 

This should format the output to 2 decimal places:

Text(
Round((Value(RetarderOil.Text)*3.6)+(Value(DataCardValue34.Text)*4.50)+(Value(DataCardValue24.Text)*3.60)+(Value(DataCardValue26.Text)*3.60)+(Value(DataCardValue29.Text)*4.20)+(Value(DataCardValue25.Text)*2.50)+If(GreaseLorryCheck.Value,10.00,0)+If(ClutchFluidCheck.Value,3.50,0)+If(FillGreaserCheck.Value,25.00,0)+If(ScreenwashCheck.Value,5.00,0),2),
"#.00"
)

 

View solution in original post

MarvinBangert
Continued Contributor
Continued Contributor

Hi @drossi 

you can use the "Text()" function to specify the text format like:

Text(Value(15.50),"[$-en-US]##.00")

this should show your result as "15.50" instead of "15.5".

You can find more examples over here: Text function - Power Apps | Microsoft Docs

 

Hope this will help you!

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

drossi
Helper III
Helper III

Thanks @MarvinBangert  @timl 

 

I tried both with no luck. Am I putting the formula in the right box?

 

Screenshot 2021-04-07 at 20.16.28.png

MarvinBangert
Continued Contributor
Continued Contributor

Hi @drossi 

the formula doesn't belong to the card, you must enter it on the label or textinput where your "100" currently is in.

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

timl
Super User III
Super User III

@drossi - It'll be the 'Text' property of the label within the card that you need to set. I imagine DataCardValue22 is the name of this label.

drossi
Helper III
Helper III

ahhh. I'm so sorry. I've tried amending but still no. Please accept my apologies!

 

It's getting late and I cannot think...

 

Screenshot 2021-04-07 at 21.00.46.png

timl
Super User III
Super User III

@drossi - the format mask should be "[$-en-GB]#.00".  In your screenshot, there are # symbols in the places where there should be 0s.

MarvinBangert
Continued Contributor
Continued Contributor

# is a placeholder, if there are any numbers, it will be filled and if there are not decimal numbers, they will not be shown. you can use "##.00" instead, if you always want to show decimal numbers. If you have any decimal numbers than it will use them and if you don't have any decimal numbers than it will use the ".00"

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

drossi
Helper III
Helper III

@MarvinBangert @timl thanks so much for your patience. 

 

It's a new morning and all is working now. Thanks again.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,265)