Created
May 13, 2014 17:19
-
-
Save jprieton/a4e805339abfdce05db1 to your computer and use it in GitHub Desktop.
Dar formato a un numero por JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var number = 10000000.00; | |
if (window.Intl && typeof window.Intl === "object") { | |
numberFormatted = new Intl.NumberFormat("es-VE", {minimumFractionDigits: 2}).format(number); | |
} else { | |
// fallback if Intl is not supported | |
numberFormated = number; | |
} | |
alert(numberFormatted); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment