Skip to content

Glossary: Kotlin Basics

format code

Also written: format codes, %.2f, %-12s, %8d

Symbols inside text used with `.format(...)` that say how to show a value. `%.2f` means a decimal with two digits after the point, and `%-12s` means a string padded to 12 characters, left-aligned.

Where the book teaches it

Related terms

string template