When the distinction between a number and a string matters, the simplest way to convert the string into a number is with an arithmetic identity operation, like adding zero, as in your last example.
The format operator is for converting data into strings (or lists of strings); its counterpart for decomposing strings into other values is "parse":
"%i" parse "123" 123 "%i|%i|%i" parse "123|34|89" (123,34,89)