MathGroup Archive 2012

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

Search the Archive

Re: Converting from string to real


You are seeing the effect of the preference setting for the
PrintPrecision display option. All of the digits can be seen by
controlling the display (or changing the preference).

x = {ToExpression["109266.75"], Pi//N}

{109267.,3.14159}

x//InputForm

{109266.75, 3.141592653589793}

x//FullForm

List[109266.75`,3.141592653589793`]

NumberForm[x,8]

{109266.75,3.1415927}


Bob Hanlon


On Wed, Jun 6, 2012 at 4:53 AM, fcaleyo <fcaleyo at gmail.com> wrote:
> 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.
> Any idea to solve this?
> Many thanks
> fcaleyo
>



  • Prev by Date: Re: Converting from string to real
  • 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