Dart Programming - toDouble Method



This method returns the double representation of the number's value.

Syntax

Number.toDouble()

Return Value

Returns a double representing the specified Number object.

Example

void main() { 
   int n1 = 2; 
   var value = n1.toDouble(); 
   print("Output = ${value}"); 
} 

It will produce the following output −.

Output = 2.0
dart_programming_numbers.htm
Advertisements