我該如何變成錢串? 1200應該是1200在javascript中轉換爲2種貨幣格式
function setdefaults() {
document.getElementById('perpetual').checked = true
document.getElementById('users').value = '1';
math_perpetual = parseInt(document.getElementById('users').value) * 1200;
document.getElementById('result').innerHTML = "The total price is $" + math_perpetual;
}
http://stackoverflow.com/questions/3753483/javascript-thousand-separator-string -format – Mate
似乎是http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript的重複。看看它。 – Mritunjay