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

Roud the value to nearest multiple of 0.5 in PowerApp ?

How to round a value to 0.5 place?

 

for example

 

0.3 to 0.5

0.5 to 0.5

0.8 to 1

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User III
Super User III

Hi @pcakhilnadh ,

See if it suits your model

With(
   {
      wVal: YourValue,
      wInt: 
      RoundDown(
         YourValue,
         0
      )
   },
   wInt + 
   Round(
      Mod(
         wVal,
         wInt
      ) / 5,
      1
   ) * 5
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

4 REPLIES 4
eka24
Super User III
Super User III

Try this:

If(Value(TextInput2.Text)<=0.5,0.5,1)
------------

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

Hi @pcakhilnadh ,

See if it suits your model

With(
   {
      wVal: YourValue,
      wInt: 
      RoundDown(
         YourValue,
         0
      )
   },
   wInt + 
   Round(
      Mod(
         wVal,
         wInt
      ) / 5,
      1
   ) * 5
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Hi, 

 

I tried this and working in label... Just wondering if how can this be force in real time once the user inputs the number in textbox? 

 

delajz_0-1627882744516.png

 

force in real time? I'm not sure what you are asking about

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,823)