.NET decimal.ToString(format) in Javascript
问题 I have a string (€#,###.00) which works fine with aDecimal.ToString("€#,###.00") in .NET, i wonder if anyone knows how this could be achieved with javascript 回答1: There's .toLocaleString() , but unfortunately the specification defines this as "implementation dependant" - I hate when they do that. Thus, it behaves differently in different browsers: var val = 1000000; alert(val.toLocaleString()) // -> IE: "1,000,000.00" // -> Firefox: "1,000,000" // -> Chrome, Opera, Safari: "1000000" (i know,