I would like to elaborate on the role of Glenn in order to make things clearer for Vahagn.
expr does not return the result in a single representation, but instead returns a value in some suitable internal format (integer, large integer, floating-point value, etc.). What you see in your testing is just a Tcl interpreter that converts the fact that expr returns to its corresponding text form, using the default conversion to a string, which for integers naturally uses base 10.
This conversion occurs in your case solely because you want to display the value returned by expr , and the display of (any) values โโnaturally tends to convert them to strings if they are "printed" on to the tkcon window, etc.
Using format , you execute any string representation that you want instead of the standard one. Since format already returns a value that is an internal string, conversion is not performed when printing. A.
source share