# How to Round double with decimal length in Dart/Flutter

In this example, we are going to show you how to delete decimal point length with round and without a round in Dart or Flutter. See the example below:

## How to Round double with decimal point length:

``````double a = 34.5355323;
double b = double.parse(a.toStringAsFixed(3)); //3 is decimal length
print(b); //output: 34.536``````

## How to delete Decimal length without Round:

``````double getNumber(double input, {int precision = 2}){
return double.parse('\$input'.substring(0, '\$input'.indexOf('.') + precision + 1));
}

double a = 34.5355323;
double c = getNumber(a, precision: 3); //3 is decimal length
print(c); //output: 34.535``````

## How to round double without decimal length:

``````double a = 34.5355323;
double d = a.roundToDouble();
print(d);  //output: 35.0``````

## How to round double and get int:

``````double a = 34.5355323;
int  e = a.round(); //round gives int in return
print(e); //output: 35``````

## How to round double and get String:

``````double a = 34.5355323;
String s = a.toStringAsFixed(2);
print(s); //output: 34.54``````

In this way, you can round double in different ways in Dart or Flutter. 