How to round double with precision after the decimal point in Dart

1 Answer

0 votes
void main() {
    double d = 3.5689;
    
    String s = d.toStringAsFixed(2);
    
    d = double.parse(s);
    
    print(s); 
    print(d); 
}




/*
run:

3.57
3.57

*/

 



answered Oct 7, 2022 by avibootz

Related questions

1 answer 157 views
1 answer 121 views
121 views asked Oct 7, 2022 by avibootz
1 answer 168 views
168 views asked May 5, 2023 by avibootz
1 answer 159 views
159 views asked Dec 19, 2022 by avibootz
2 answers 222 views
2 answers 194 views
194 views asked Oct 19, 2022 by avibootz
...