format-number xslt function similar function in javascript

0 votes

I found very useful jQuery plugin to format the numbers. Which is similar to format-number function in xslt.

<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="jquery.numberformatter-1.1.2.min.js" type="text/javascript"></script>
<div id="formatString"></div>

<script type="text/javascript">
function FormatNumber(value, formatStr)
{
    $("#formatString").html(value);
    $("#formatString").format( {format: formatStr, locale: "US"} );
    return $("#formatString").html();
}

$(document).ready(function() {
    FormatNumber("3356305", "#,###,##0.00");
});
</script>

 

jQuery website
jQuery Number Formatter
jQuery Number Formatter Download Page

 

asked Jan 28, 2013 by inquirer (710 points)
    

Please log in or register to answer this question.

...