I'm working on this slider through the use of a javascript function however the output shows a 12 decimal places. I'd like for it to be reduced to 2. I'm super new this javascript so I'd greatly appreciate your help implementing your solution.
$(document).ready(function () {
function moveSlider(e){
var pos = $(e.currentTarget).offset()
, posX = e.pageX - pos.left
, value = posX*10000/$(e.currentTarget).outerWidth();
if(posX >= 0 && posX <= $(e.currentTarget).outerWidth()){
$('.slider > .progress').css('width', posX+'px');
$('.slider > .indicator').css('left', posX+'px');
$('#valueSlider').val(value);
}
}
$('.slider').on('mousedown', function(e){
moveSlider(e);
$(this).on('mousemove', function(e){
moveSlider(e);
});
}).on('mouseup', function(){
$(this).off('mousemove');
});
});