How to properly manage the quantity and fee?

So, I open BUY order for ETHUSDT for 0.0178 ETH because stepSize: 0.0001 Without fee it was 0,0177822

Then I decided to sell ETH, but I can sell only 0.0177 because stepSize: 0.0001. So, I sold and currently I have 0.0000822 ETH and I can’t sell it because stepSize: 0.0001
image

I could add fee to quantity before buy, but I can’t buy 0,0178178 because stepSize: 0.0001

So, how to properly manage the quantity to avoid such tails?

Maybe you could consider enable the feature that pay trading fee by BNB, then you will have no such concern.

Where can I enable this? Or which API method to use for this?