Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Sliders: Single Value - Displaying 2 decimal places always for all slider values

Using the "Sliders: Single Value" feature from the Question Library which is delightful.

I am displaying interest rates from 6% to 15% with 0.25% steps.

It appears to be working nicely.

Just a few cosmetic issues to deal with.

For example: I would prefer to have 6% display as "6.00%" and 14.5% display as "14.50%". So 2 decimal places always would be ideal for the purpose of this question.

Hoping for a handy solution overnight.

Many thanks.
asked May 25 by Paul Moon Platinum (94,725 points)

1 Answer

+2 votes
Run a search on the question code for this:

$(this).find('.sliderHandle')


In both locations, the code will look something like this:

$(this).find('.sliderHandle').text(xyz);


Change that to look like this:

$(this).find('.sliderHandle').text(Number(xyz).toFixed(2));
answered May 25 by Zachary Platinum Sawtooth Software, Inc. (188,000 points)
Works like a charm mate.

Thanks Zachary. Awesome as always.
...