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

#### April 4th Copilot Studio Coffee Chat | Recording Now Available

Did you miss the Copilot Studio Coffee Chat on April 4th? This exciting and informative session with Dewain Robinson and Gary Pretty is now available to watch in our Community Galleries!   This AMA discussed how Copilot Studio is using the conversational AI-powered technology to aid and assist in the building of chatbots. Dewain is a Principal Program Manager with Copilot Studio. Gary is a Principal Program Manager with Copilot Studio and Conversational AI. Both of them had great insights to share with the community and answered some very interesting questions!     As part of our ongoing Coffee Chat AMA series, this engaging session gives the Community the unique opportunity to learn more about the latest Power Platform Copilot plans, where we’ll focus, and gain insight into upcoming features. We’re looking forward to hearing from the community at the next AMA, so hang on to your questions!   Watch the recording in the Gallery today: April 4th Copilot Studio Coffee Chat AMA