Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Converting from string to real

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126788] Re: Converting from string to real
  • From: A Retey <awnl at gmx-topmail.de>
  • Date: Thu, 7 Jun 2012 05:21:25 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jqn5mn$her$1@smc.vnet.net>

Am 06.06.2012 10:51, schrieb fcaleyo:
> Hi guys, I've got a problem with ToExpression[].
> It seems to round large real numbers off, e.g.
> ToExpression["109266.75"] returns 109267., still a real, yet not exactly what the original string meant.

it doesn't round, it just doesn't print more than 6 digits with the 
default settings.

> Any idea to solve this?

You can use InputForm to see that it really knows all digits (and will 
use them for any further calculation):

ToExpression["109266.75"]//InputForm

You could also change the "Displayed precision" from Edit -> Preferences 
in the Apearance -> Numbers -> Formatting tab.

Other than that, there isn't anything to solve really :-)

hth,

albert




  • Prev by Date: please help using NDSolve and FindFit
  • Next by Date: Re: Converting from string to real
  • Previous by thread: Re: Converting from string to real
  • Next by thread: Re: Converting from string to real