formating number to currency with commas in jquery with slider
<p>I'm trying to get the output formatted like 1,023,456.50  also for ui.values[ 0 ]
But it shows NaN.
Any ideas?</p>

<p><a href="http://jqueryui.com/slider/#range" rel="nofollow">http://jqueryui.com/slider/#range</a></p>

<pre><code>$(function() {
        $( "#slider-range" ).slider({
              animate: true,
            range: true,
            min: 0,
            max: 10000000,
            step: 10000,
            values: [ 2000, 8888888 ],
            slide: function( event, ui ) {
                $( "#price-range" ).val( + ui.values[ 0 ].toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") + " - " + ui.values[ 1 ].toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") );

            }
        });
        $( "#price-range" ).val( + $( "#slider-range" ).slider( "values", 0 ).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") +
            " - " + $( "#slider-range" ).slider( "values", 1 ).toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") );
    });
</code></pre>

<p>For the original Code please see : <a href="http://jqueryui.com/slider/#range" rel="nofollow">enter link description here</a></p>
