Scala Int toDouble() method with example
Last Updated :
04 Feb, 2020
The toDouble() method is utilized to convert the specified int number into double data type 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 = ( 12 ).toDouble
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...