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

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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 I
Helper I

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
Responsive Resident
Responsive Resident

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 I
Helper I

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
Responsive Resident
Responsive Resident

# 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 I
Helper I

@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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (47,671)