Scala Float toDouble() method with example
Last Updated :
29 Oct, 2019
The toDouble() method is utilized to convert the specified number into double datatype value.
Method Definition: (Number).toDouble
Return Type: It returns the converted double datatype value.
Example #1:
object GfG
{
def main(args : Array[String])
{
val result = ( 1 ).toDouble
println(result)
}
}
|
Example #2:
object GfG
{
def main(args : Array[String])
{
val result = ( 9.5467 ).toDouble
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...