I have the following code, which I expected tips is 0.00
at the end of the run. However it's 0.0
.
print("cart['tips_percent']");
print(cart['tips_percent']);
print ("subTotal");
print (subTotal);
double tips = cart['tips_percent'] * subTotal;
tips = num.parse(tips.toStringAsFixed(2));
print(tips);
The log gives
I/flutter (31838): cart['tips_percent']
I/flutter (31838): 0.0
I/flutter (31838): subTotal
I/flutter (31838): 95.92
I/flutter (31838): 0.0