I welcome everyone. Can you please tell me how to compare 2 List, rounding the values, for example, to two decimal places?
We have
var list1 = [3425,5559394484, 2351,4392210480, -2384,4831199322];
var list2 = [3425,5559394472, 2351,4392210480, -2384,4831199122];
You need to compare the values of the lists, rounding them up to 2 decimal places. the result should
be
print(ListEquality().equals(list1, list2)) // true
What is the best way to implement comparison? Thanks to everyone who will respond.
3
Answers
Besides using answer below comment, you can do like this:
You can try the below soln
I make method for length & equality which return true or false