cancel
Showing results for
Did you mean:
Memorable Member

## Slider Control w/ Fractional Inches?

Hello,

I'm trying to make a slider that has whole numbers and 1/16" increments.

Example:

- User moves slider and selects 45 3/16" (Forty five and three sixteenth inches).

I'm thinking of using a Switch() statement that maps decimal to fractional inches.

I have two labels, one for the whole number and one for the fractional number. The fractional number is set to the Switch statement below.

Something like:

``````Switch(
Value(Concatenate(".", Last(Split(Slider1.Value, ".")).Value)) / 16,
.0625, "1/16",
.125, "1/8",
.1875, "3/16",
.250, "1/4"
)``````

But this doesn't seem to work. The slider seems to jump to only the whole numbers. The fractional label never renders.

Has anyone attempted this?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support

The logic in your formula is incorrect. Please try below formula and set max number of the slider to 1600:

``Text(Slider1.Value/16,"0")&" "&Switch(Last(Split(Text(Slider1.Value/16),".")).Value,"0","","0625","1/16","125","1/8","1875","3/16","250","1/4","3125","5/16","375","3/8","4375","7/16","5","1/2","5625","9/16","625","5/8","6875","11/16","75","3/4","8125","13/16","875","7/8","9375","15/16")``

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

5 REPLIES 5
Memorable Member

Closer with this:

But the slider jumps more than the fractions listed. Like jumps by 3/4"...strange.

Community Support

The logic in your formula is incorrect. Please try below formula and set max number of the slider to 1600:

``Text(Slider1.Value/16,"0")&" "&Switch(Last(Split(Text(Slider1.Value/16),".")).Value,"0","","0625","1/16","125","1/8","1875","3/16","250","1/4","3125","5/16","375","3/8","4375","7/16","5","1/2","5625","9/16","625","5/8","6875","11/16","75","3/4","8125","13/16","875","7/8","9375","15/16")``

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Memorable Member

Hi @v-jefferni ,

Thank you for the solution. I will test it out. I will be dynamically setting the Min/Max of the Slider.

Can you tell me about the Max value of 1600? Is it required?

Community Support

Just because the default max number is 100. According to your need, if the max number showing in the Label is 50, multiply 50 with 16 which is 800 as max number of the slider.

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Memorable Member

Ah, ok. So Max inches * 16, Min inches * 16. That makes sense to me.

Here is the working code for anyone else that needs it:

``````Concatenate(
Text(Slider1.Value / 16, "0"),
Switch(
Value(Concatenate(".", Last(Split(Slider1.Value / 16, ".")).Value)),
.0625, " 1/16",
.125, " 1/8",
.1875, " 3/16",
.250, " 1/4",
.3125, " 5/16",
.375, " 3/8",
.4375, " 7/16",
.5, " 1/2",
.5625, " 9/16",
.625, " 5/8",
.6875, " 11/16",
.75, " 3/4",
.8125, " 13/16",
.875, " 7/8",
.9375, " 15/16"
)
)``````

Thank you @v-jefferni .

Announcements

#### Celebrating the May Super User of the Month: Laurens Martens

@LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!

#### Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!