Why are parens required around format strings?

@eelis, yes, f-strings are my favorite as well in Python for string formatting. To do this in Fortran, why not exactly the same syntax:

character(:), allocatable :: s, text
integer :: i
real :: a
i=1
a=1.123456789
text="this"
s = f"{i} is an integer, {a:1.2f} is a rounded real and '{text}' is text"
print *, s ! or rather print(s) !!
1 Like