-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Price Precision Config #86
Comments
I wonder if there is a sensible default that could be applied here. If we were to expose an option to set precision globally, stocks with high and low value per unit may look odd e.g. (100000.00000 and 0.00013). This issue warrants a solution but what the solution is is not yet clear to me. |
Maybe we can decide it for each stock automatically. Yahoo Finance shows max 4 digits min 2 digits after dot.
If it makes sense to you, I can open a PR for it. https://play.golang.org/p/KeT4xrw4p6n |
Your suggestion looks sensible to me. A PR would be very much welcome :) |
* Add adaptive precision for values Fixes #86 * Handle negative values and fix summary tests * Fix watchlist tests
Thanks for great tool.
Number of the digits after the decimal point isn't enough especially for cryptocurrencies. Currently, precision is set to 2 in
ticker/internal/ui/util/format.go >> ConvertFloatToString(f float64) string
file. It's very small.precision
configuration might be great.I thought to open a PR, but I couldn't find a way to access config value in
ConvertFloatToString
. I didn't want to addprecision
as parameter to lots of places such asConvertFloatToString
,ValueText
,watchlist.NewModel
,watchlist.item
etc.The text was updated successfully, but these errors were encountered: