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) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -