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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -