I'm not very knowledgeable of String formatting, so I was hoping someone could answer what I hope will be an easy question:
I am using String.format to format Strings into some specified pattern. How would I write the format String for currency?
For example, I'd like to convert:
I attempted something as simple as:
If I input: 105.1000032Code java:
It converts it to: $10
And if I input 1005.1000032
The test program never actually starts up. I assume some sort of infinite loop or something going on, but I don't care right now since my format is incorrect anyway.
What should my format String be? Keep in mind that I am NOT converting it to a number type before formatting it.