MathGroup Archive 2005

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

Search the Archive

Re: Converting from string to integer

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56405] Re: Converting from string to integer
  • From: Peter Pein <petsie at arcor.de>
  • Date: Sun, 24 Apr 2005 03:28:55 -0400 (EDT)
  • References: <d4clnt$33b$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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