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