java - How do I escape the ',' character in System.out.format? -
i want output 2 numbers separated comma using system.out.format
. tried escape %, didn't help.
target output should in form of (0.92,0.91)
system.out.format("(%.2f% %.2f)%n", x, fx); ^--- want add ',' character here
you don't have escape comma in format. place comma in format, without percent sign next it.
system.out.format("(%.2f,%.2f)%n", x, fx);
Comments
Post a Comment