简体   繁体   中英

Unsupported format character when using string formatting

The problem is that I'm getting this error message:

unsupported format character ',' (0x2c) at index 27

While using the string formatting on this:

v = 60 / 100.0
messenger.append("Base Skill Level +%,0f" % chop(20 + 15 * v))

messenger.append works just like the print() if someone would be curious.

The question is, how to solve this? I cant see the problem here as far as , is required here: %,0f .

I'm using Python version 2.2

I think you meant %.0f instead of ,0f . As far as I know, there is no such thing as ,0f

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM