Answers for "flutter time round values"

1

dart round

void main() { 
   double n1 = 12.023; 
   double n2 = 12.89; 
   
   var value = n1.round(); 
   print( value ); 
   
   value = n2.round(); 
   print( value ); 
}
Posted by: Guest on November-13-2021
0

round off double in flutter

import 'dart:math';

double roundDouble(double val, int places){
  num mod = pow(10.0, places);
  return ((val * mod).round().toDouble() / mod);
}
Posted by: Guest on December-15-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language