I need to format negative and positive integers like 23974 and -98732 in this way:
23,974
(98,732)
The positive ones aren't that hard:
For the negative ones, this seems to work for me:
However, the
DecimalFormat doc advises not to call the DecimalFormat constructors directly. Is there another/better way to do this?
Also, it looks like I can't do the parentheses for negatives on percents, because I only know how to call this:
And NumberFormat doesn't have those methods I used above...