I state that I am new with Flutter.
I would like to do 50/2
I try with the DartPad
print((50/2).toString()); // return 25
I try the Flutter debugger build that I installed in a Pixel 4 emulator
print((50/2).toString()); // return 25.0
Why does the ".0" return? Was I wrong to do something? Is everything normal and is it kind of a code conversion?
How can I get it without ".0"?
ps. This is a case but I'm also talking about more complex situations where instead of doing a precise division, I could divide two variables (which maybe are not int but double) and / or do other operations. I've already evaluated things like toStringAsPrecision, it works for the single case but messes up the string if it contains true decimals.
ps2. The only solution that came to my mind is to replace the .toString with a custom extension method that eliminates superfluous zeroes (also considering the decimal point)