Apparently toLocaleString doesn't work in safari and firefox. I guess I'll do the formatting by hand.