In questo semplice ma utile tutorial imparerete come creare una finzione che formatta un prezzo in Javascript.
function formatMoney(number){
var format_money = "";
while (parseInt(number) > 999) {
format_money = "," + number.slice(-3) + format_money;
number = number.slice(0, -3);
}
return number + format_money;
}
fonte: www.sastgroup.com ? Vai al post originale






