For example i have value 1.6174 and i want to to check if digit 4 after dot (4) round up or down in flutter.
Example 1.6174 = 1.617 if 1.6176 = 618.
Thank you in advance.
use this code:
var num = 1.6176;
(num*1000).ceil()/1000;
https://dartpad.dartlang.org/1c11e8e1352417080cd837a28539e827
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With