Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.util.UnknownFormatConversionException: Conversion = 'i' error

 
Nick Petas
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the source code :



The code that produces the error of the topic is bold.
Thank you.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problem is with the percent symbol, "%", as the printf method thinks that it's a format specifier. To use it literally as a percent symbol, you'll need to use two of them in a row. So change this:


to this:
 
fred rosenberger
lowercase baba
Bartender
Posts: 12145
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bold tag does not work inside the 'code' tags. Referring to the specific line number where the error is would be the best way.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic