# ToExpression and Fortran notation

ToExpression["9.0E-03"]


interprets String as

9*e - 3


instead of what I am expecting

0.009


How can I convert to expression Fortran notation?

-
ToExpression[StringReplace["9.0E-03", "E" -> "*^"]] –  rasher May 23 '14 at 7:11
@rasher thank you! –  user1541776 May 23 '14 at 7:28

You can use ImportString, with the "Table" or "List" argument. See the documentation for details.

ImportString["9.0E-03", "Table"]

(* {{0.009}} *)


or

ImportString["9.0E-03", "List"]

(* {0.009} *)

-
thank you! I'm a bit puzzled though with Mathematica's architecture: why is it a separate function and moreover contains Import in its title? –  user1541776 May 23 '14 at 7:30
ImportString takes a String as argument and provides the same output as Import, which takes a file as Argument. –  Markus Roellig May 23 '14 at 7:37
thank you, now it's clear. –  user1541776 May 23 '14 at 7:45