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
Super User

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
Super User
Super User

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
Super User

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"
)

 

MarvinBangert
Super User
Super User

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.

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

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
Super User

@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
Super User

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

# 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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,222)