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 190 views
1 answer 131 views
131 views asked Oct 7, 2022 by avibootz
1 answer 181 views
181 views asked May 5, 2023 by avibootz
1 answer 175 views
175 views asked Dec 19, 2022 by avibootz
2 answers 243 views
2 answers 210 views
210 views asked Oct 19, 2022 by avibootz
...