Store a formatted message in a variable (does not work on zsh)

printf

printf -v {{myvar}} {{"This is %s = %d\n" "a year" 2016}}

click the source code to copy install printf on any operating system with command-not-found.com