Scala Long toDouble() method with example
Last Updated :
03 Nov, 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 Test
{
def main(args : Array[String])
{
val res = ( 3 ).toDouble
println(res)
}
}
|
Output:
3.00
Example 2:
object Test
{
def main(args : Array[String])
{
val res = ( 9.8796 ).toDouble
println(res)
}
}
|
Output:
9.8796
Share your thoughts in the comments
Please Login to comment...