There is a slider on the site, made with pom ui slider joxi.ru/v29Xpo3IGnaepm. How can one divide between numbers in the output value so that there are 2 500 000 and 2500 000?
1 answer
If by ui slider you mean jquery, then ... In any case, use the regular result for the result.
$("#slider").slider({ range: "min", min: 1800000, max: 12000000, step: 500000, value: 1800000, slide: function() { val = '' + $('#slider').slider('value') $("#amount").val(val.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, "$1 ")); } }); <link href="https://code.jquery.com/ui/jquery-ui-git.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <p> <label for="amount">Price:</label> <input type="text" id="amount" readonly> </p> <div id="slider"></div> |