Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add adaptive precision for values #122

Merged
merged 3 commits into from
Feb 20, 2021

Conversation

enescakir
Copy link
Contributor

Number of the digits after the decimal point isn't enough especially for cryptocurrencies.

In this PR, we decide it for each stock adaptively. Yahoo Finance shows max 4 digits min 2 digits after dot.

       stock < 10       --->   precision: 4     i.e.: 0.4375, 1.5436
 10 <= stock < 100      --->   precision: 3     i.e.: 10.543
100 <= stock            --->   precision: 2     i.e.: 100.30, 49435.97

Fixes #86

@achannarasappa achannarasappa merged commit 5851089 into achannarasappa:master Feb 20, 2021
@achannarasappa
Copy link
Owner

Looks good to me thanks for the PR!

@enescakir enescakir deleted the adaptive-precision branch February 22, 2021 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Price Precision Config
2 participants