java - Decimal format class problems -


i have string , im trying format decimal format there , every 3 numbers using decimal format class im having troble. here code

 public string getnum()    {      //turn string mynum formatted number there's , after every 3 digits       decimalformat formnum = new decimalformat(mynum "000,000");      //set formnum string don't know method use step       return formnum ;   } 

mynum text document , number 6486 in instance in others using same code gets way 301122. method want turn these numbers things such 6,486 or 301,112 constructor statement ide telling in ")"is expected i'm not sure how change decimal format string once format number.

you missed comma there after mynum. also, should be

decimalformat formnum = new decimalformat("000,000"); return formnum.format(mynum); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -