loopj / jquery-simple-slider

Unobtrusive numerical slider plugin for jQuery
194 stars 113 forks source link

adding thousands separator and unit sign ($, %, etc.) to output #40

Open mambochan opened 11 years ago

mambochan commented 11 years ago

Hi, I am a jquery newbie and having trouble locating the solution.

Is there any way you can add a thousands separator and an unit sign to the output value?

For instance, "$125,000", "2.5%" etc.

Thanks very much.

ohepworthbell commented 10 years ago

On the off-chance this is still required:

First, JS: $('input[type="data-slider"]').bind("slider:changed", function() { var i = $(this).val(); $('#outputWrapper').html('£' + i); });

then HTML: <input type="text" value="0" data-slider="true" /> <span id="outputWrapper">£0</span>

mambochan commented 10 years ago

Thanks very much for kindly supplying me with this info.

Masato Tsukada

On Apr 22, 2014, at 5:21 AM, ohepworthbell notifications@github.com wrote:

On the off-chance this is still required:

First, JS: $('input[type="data-slider"]').bind("slider:changed", function() { var i = $(this).val(); $('#outputWrapper').html('£' + i); });

then HTML:

£0

— Reply to this email directly or view it on GitHub.