I feel a bit stupid about this, but I haven't figured out how to printed a formatted number to the console in Java. I was hoping for a "printf" or something like it. Here is a sample of what I'd like to do:
which prints out an accurate but useless table of numbers with 15 digits of accuracy. How can I make it print out only one or two digits? Thanks in advance.
Thomas, you are the man. Not only will that do what I want, it will do it in my localization (Spain) which means numbers like "32,5". Thanks very much.