Open In App

Scala Int floatValue() method with example

Last Updated : 30 Jan, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

The floatValue() method is utilized to return the float value of the specified int value.

Method Definition: def floatValue(): Byte

Return Type: It returns the float value of the given int value.

Example #1:




// Scala program of Int floatValue
// method 
    
// Creating object 
object GfG 
{  
    
    // Main method 
    def main(args:Array[String]) 
    
        
        // Applying floatValue method 
        val result = (15).floatValue
            
            
        // Displays output 
        println(result) 
        
    


Output:

15.0

Example #2:




// Scala program of Int floatValue
// method 
    
// Creating object 
object GfG 
{  
    
    // Main method 
    def main(args:Array[String]) 
    
        
        // Applying floatValue method 
        val result = (1586).floatValue
            
            
        // Displays output 
        println(result) 
        
    
}  


Output:

1586.0


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads