MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Converting from string to integer


Magnus wrote:
> Hey folks,
> 
> I have strings consisting of numbers. Now; how do I make them all of integer
> type?
> 
> Ex:
> "0123" ---> 123
> 
> Thanks,
> 
> Magnus,
> Norway
> 
> 
Each of the following lines leaves you with an integer:

ToExpression["0123"]

ToExpression["0.123"]//Round

ToExpression["12.3I"]//Abs//Round

-- 
Peter Pein
Berlin


  • Prev by Date: Shell script and Mathematica.
  • Next by Date: Re: Re: A bug in Integrate ?
  • Previous by thread: Re: Converting from string to integer
  • Next by thread: Re: Converting from string to integer