Add width placeholder specifier
This commit is contained in:
parent
18da65a933
commit
7fc76bdb93
@ -33,4 +33,5 @@ func Formatting() {
|
|||||||
f("go num width (left align): |%-5d|\n", 2)
|
f("go num width (left align): |%-5d|\n", 2)
|
||||||
f("go float precision (left align): |%-5.2f|\n", 3.141516)
|
f("go float precision (left align): |%-5.2f|\n", 3.141516)
|
||||||
f("go char: %c\n", 97)
|
f("go char: %c\n", 97)
|
||||||
|
f("go custom width specifier: |%*s|\n", 5, "foo")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user