diff options
Diffstat (limited to 'sources/scala')
-rw-r--r-- | sources/scala/Console.scala | 6 | ||||
-rw-r--r-- | sources/scala/runtime/compat/Platform.scala | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sources/scala/Console.scala b/sources/scala/Console.scala index 86f62276f1..f9ec8fc490 100644 --- a/sources/scala/Console.scala +++ b/sources/scala/Console.scala @@ -164,11 +164,13 @@ object Console { /** Read a float value from the terminal. */ - def readFloat: Float = java.lang.Float.parseFloat(in.readLine()); + def readFloat: Float = + scala.runtime.compat.Platform.parseFloat(in.readLine()); /** Read a double value from the terminal. */ - def readDouble: Double = java.lang.Double.parseDouble(in.readLine()); + def readDouble: Double = + scala.runtime.compat.Platform.parseDouble(in.readLine()); /** Read in some structured input, specified by a format specifier. * See class <code>java.text.MessageFormat</code> for details of diff --git a/sources/scala/runtime/compat/Platform.scala b/sources/scala/runtime/compat/Platform.scala index d0fa630f8f..05a6f8e21e 100644 --- a/sources/scala/runtime/compat/Platform.scala +++ b/sources/scala/runtime/compat/Platform.scala @@ -19,4 +19,6 @@ object Platform { def split(str: String, separator: Char): Array[String] = { str.split(separator.toString()); } + def parseFloat(s: String): Float = java.lang.Float.parseFloat(s); + def parseDouble(s: String): Double = java.lang.Double.parseDouble(s); } |