Then, I want to format some floating point number rounded:
>>> value = 5.1234
>>> f"the value is {value:.2f}"
'the value is 5.12'
I like this syntax because the formating part (i.e. .2f) is close to the one used by printf and a lot of unix tools I know and it does not clutter the readability of the string.
With fmt:
> putStrLn $ "the value is " +| fixedF 2 value
the value is 5.12
I always forgot the trailing space after "is" and I had to look at the documentation to find fixedF, everytime.
And when done, ping this guy: https://www.reddit.com/r/haskell/comments/72ubj8/naive_format_strings_using_template_haskell/dnowzd5/
His complaint is pretty valid: