Dart Programming – round Method

  • Post author:
  • Post category:Dart
  • Post comments:2 Comments
dart programming round method

In this guide, we will discuss round Method in Dart Programming Language. This method returns the value of a number rounded to the nearest integer.

Syntax

Number.round()

Return Value

Returns the value of a number rounded to the nearest integer.

Example

void main() { 
   double n1 = 12.023; 
   double n2 = 12.89; 
   
   var value = n1.round(); 
   print( value ); 
   
   value = n2.round(); 
   print( value ); 
} 

It will produce the following output −.

12 
13

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply