I spoke with someone on Discord who gave me a similar response regarding the inaccuracies of using stepify
on a float.
The initial thought was to handle the user input beyond 2 decimal places and round it.
I tested the rounding by making another simple script that didn't use get_text()
and the values were correct.
My errors appeared when using get_text()
.
Upon further research of how trading platforms figure the cost basis, it appears most traders do not enter half a cent (2 decimal accuracy, ie. 0.01) on trading platforms unless they are trading penny stocks (which open a whole other can of worms) I believe that is 4 decimal accuracy (ie. 0.0001).
I have may just limit the user input to 2 decimals for now and add an option for how many decimal accuracy is desired later; however I was curios about the problem.