RoboZonky / natural-strategy-setup

Webový konfigurátor investiční strategie pro RoboZonky
https://robozonky.github.io/konfigurace-strategie/
2 stars 1 forks source link

The tool doesn't allow float interest values, leading to invalid strategies #37

Closed jhrcek closed 6 years ago

jhrcek commented 6 years ago

@triceo just for fun, here's why i didn't notice this bug (and why my "randomized strategy tests" didn't catch the issue). In those tests I'm generating random float in the range 0 - 100. This typically leads to random floats with many decimal places (like 15,1565646542). So the comma was always there in the randomly generated strategy and was accepted as correct by Robozonky strategy parser.

Another issue is that the UI field for interest rate itself only allows Ints.

I noticed this only now when working on Shareable URL shortening. To make the randomly generated strategy look more like from human (who isn't likely to enter numbers with many decimal places) I made the random floats to be rounded to 2 decimal places, which sometimes leads to values like 15,00, which elm's toString shows as 15 (i.e. no comma), leading to unparseable strategy..

Fix is coming shortly :-)

jhrcek commented 6 years ago

Fixed as a part of https://github.com/RoboZonky/natural-strategy-setup/commit/5f4377967e02e9005db95e5a161ffa09a8c902f6