Truncating the string length in Formatting.jl

In this snippet:

using Formatting
s = "123456789"
printfmtln("{}--{:6.6s}", s, s) 

I would like the second occurrence of s to be truncated to 6 characters, but I’m getting:

123456789--123456789

Is there a format definition, which does it? Looking at Python docs, I thought that {:6.6s} should do it.

This should work. I have filed an issue for this

1 Like