How to use @sprintf with "parametric" format string?

ryszard314159
Tue, 26 Oct 2021 01:10:21 +0000
General Usage

Is there a way to use @sprintf with “parametric” format string? or it has to be hardcoded?
This is an example:

julia> @sprintf(“test: %s”, “test”)
“test: test”
julia> fmt = “test: %s”; @sprintf(fmt, “test”)
ERROR: LoadError: ArgumentError: @sprintf: first argument must be a format string

6 posts - 5 participants