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

Rounding Functionality in PowerApps

I'm working on building my first App.  A fairly simple calculator to multiply a cost per SF.  But I'd like for the final result to be number rounded to the nearest thousand.  The application is working when calculating actual numbers but I can't get the rounding functionality to work.  I've looked at a few examples but none of them are working for me.   

 

Calculator is using a user entered SF (TextInput2) multiplied by a dropdown value based on Building type.  The formula for that works great - UpdateContext({Result: Dropdown1.Selected.PerSF * TextInput2}) 

 

But when I try to modify based on some online examples, it's not rounding.  

Round(UpdateContext({Result: Dropdown1.Selected.PerSF * TextInput2}), 2) *1000 

 

Any suggestions on how to get this to work? 

2 ACCEPTED SOLUTIONS

Accepted Solutions
BCBuizer
Super User
Super User

Hi @MrQuarry ,

 

It seems your nesting order is wrong: you are first setting the Result and then rounding it. can you try:

 

UpdateContext({
	Result: 
	Round(
		Dropdown1.Selected.PerSF * TextInput2,
	2) * 1000
}) 

 

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

Gochix
Solution Sage
Solution Sage

Hi @MrQuarry ,

I believe you have the wrong order for the formula. As the UpdateContext must be first then:


UpdateContext({Result: Round(Dropdown1.Selected.PerSF * TextInput2, 2) * 1000})

View solution in original post

3 REPLIES 3
BCBuizer
Super User
Super User

Hi @MrQuarry ,

 

It seems your nesting order is wrong: you are first setting the Result and then rounding it. can you try:

 

UpdateContext({
	Result: 
	Round(
		Dropdown1.Selected.PerSF * TextInput2,
	2) * 1000
}) 

 

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
Gochix
Solution Sage
Solution Sage

Hi @MrQuarry ,

I believe you have the wrong order for the formula. As the UpdateContext must be first then:


UpdateContext({Result: Round(Dropdown1.Selected.PerSF * TextInput2, 2) * 1000})

MrQuarry
New Member

Thank you @BCBuizer  & @Gochix  - that was the issue.  I appreciate your help.  I'm a newbie here just learning the ropes.  

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.

Users online (1,547)