You need to look at the API doc for the Formatter class to see how to code format Strings.
The error message says: f is not used to format Strings
Type: Posts; User: Norm
You need to look at the API doc for the Formatter class to see how to code format Strings.
The error message says: f is not used to format Strings
Looks like you have changed the code. Does the code now assign a value to pData before it is used?
--- Update ---
You need to look at the API doc for the Formatter class to see how to code...
Can you do the simple thing of adding the println statement so the code looks like this:
System.out.println("pData="+pData); // print the value of pData BEFORE using it on next line
pData...
Can you post the code that printed the "nu"?
Did you print the value of pData BEFORE the format() statement was executed?
Please copy text and paste it here. Images are too small to read.
pData = String.format("%8.2f%n", pData);
What printed out for the value of pData when you printed it BEFORE the above...
What value is in pData when it is formatted? Add a println just before the format() statement and print out the value of pData so you can see.
What variable has the "nu" String in it? What did you expect to see where the "nu" is shown?
Is there code that takes the first 2 characters of null?
The posted code doesn't show the source or...
Can you copy the contents of the textarea and paste it here with some comments saying what the problem is with it?
Are there error messages? Copy them and paste it here.
Insert an end line character: "\n" where you want a line to end and the next part of the String to be on the next line.