var n = 15425.56;
var output = n.format(2, ",", ".");
alert(output); // el resultado es "15.425,56"
xxxxxxxxxx
<html>
<head>
<title>Ejemplo de formato de números</title>
<script type="text/javascript" src="format_number.js"></script>
</head>
<body>
<script type="text/javascript">
var n = 15425.56;
var output = n.format(2, ",", ".");
var output_2 = n.format(n % 1 === 0 ? null : 2, ",", ".");
var output_3 = n.format(0, ",", ".");
alert(output); // "15.425,56"
alert(output_2); // "15.425,56"
alert(output_3); // "15.425"
</script>
</body>
</html>