Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conver string to integer

Status
Not open for further replies.

snowingnow

Programmer
Jun 1, 2006
32
0
0
CA
What function could i use to convert a string to integer, such as a truncated string is "33" and I would like to conver to integer as 33. Thanks
 
In Tcl, everything is already a string. As Feherke says, expr will deal with strings as integers; some commands deal with strings as if they were lists, etc. Now, if you want to format a string, that might otherwise be construed as, say, a floating point number, as an integer, you can always use format

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top