There are way too many questions and answers about this basic functionality, I cannot see the wood for the trees.
In Java there is only one simple answer (java.text.NumberFormat
and its subclasses) so I'm sure the majority of plugins, questions and answers will mature eventually to a de-facto standard for JQuery.
This plugin is the best I found so far, but I don't know if it's still developed, is mature etc.
http://plugins.jquery.com/project/numberformatter
Is there a better solution? Is it mature / active enough to rely on?
Edit:
I would like to be able to format currencies, decimal, integers based on the same format patterns Java uses, so that data recieved on the client side can be formatted without sending it first to the server.
e.g.
Format 1000
to $1,000
or 1,000.00
etc (locale support is nice)
Seems that http://plugins.jquery.com/project/numberformatter does the job but the question was: "Am I using the right thing?" or "Is there a better way to do so?"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…