//dart code
double x = 5.56753;
String roundedX = x.toStringAsFixed(2);
print(roundedX);
var foo = 6.28;
print(foo.round()); // 6
var bar = 6.5;
print(bar.round()); // 7
void main() {
double n1 = 12.023;
double n2 = 12.89;
var value = n1.round();
print( value );
value = n2.round();
print( value );
}
import 'dart:math';
double roundDouble(double val, int places){
num mod = pow(10.0, places);
return ((val * mod).round().toDouble() / mod);
}