Skip to content

Fix amount output when minority more then 100 #625

Merged
merged 5 commits into from
May 8, 2018

Conversation

romanlex
Copy link
Contributor

@romanlex romanlex commented Apr 12, 2018

Не знаю как у вас)
но конструкция Math.log(1000) / Math.LN10 от 1000 выдаст 2.99999999996
Отсюда кажется конструкция в целом оверхедом...почему бы просто не взять .log10 от числа

Не знаю как у вас)
но конструкция `Math.log(1000) / Math.LN10` от 1000 выдаст `2.99999999996`
Отсюда кажется конструкция в целом оверхедом...почему бы просто не взять .log10 от числа
@stepancar
Copy link
Contributor

stepancar commented Apr 21, 2018

@romanlex https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Math/log10
Обратите внимание, что то что log10 - нужно полифилить. Тот код, который вы меняете и есть полифил к log10 единственное он действительно неверно написан, видимо взят с просторов stackOverflow).
Нужно использовать return Math.log(x) * Math.LOG10E

Copy link
Contributor

@stepancar stepancar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Math.log(x) * Math.LOG10E

@romanlex
Copy link
Contributor Author

wow, благодарю...упустил из виду, обновил

@SiebenSieben SiebenSieben merged commit 52f13ad into alfa-laboratory:master May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants