as we all know, both of
import strformat
var
i = 16
echo fmt"{16:x}"
echo fmt"{i:x}"
print 10
now, is it possible to use the format specifier in variant f? None of the following is corrected
import strformat
var
i = 16
f = 'x'
then
echo fmt"{i:f}"
or
echo fmt"{i:{f}}"
or
echo fmt"\{i:{f}\}".fmt
You can use formatValue from strformat module: https://play.nim-lang.org/#ix=2etN
(see https://nim-lang.org/docs/strformat.html#implementation-details)