achannarasappa / ticker

Terminal stock ticker with live updates and position tracking
GNU General Public License v3.0
4.98k stars 271 forks source link

Force x number of decimal places in prices #198

Open ajgringo619 opened 3 years ago

ajgringo619 commented 3 years ago

Problem Statement Some of my crypto assets have extremely low values per token. I would like to be able to see the full value of these tokens, but 4 decimal places is not enough.

Proposed Solution Allow users to specify the number of decimal places to show, maybe on a graduated scale (no need to show 8 decimal places for Bitcoin, for example).

shaunmolloy commented 3 years ago

Example of this on a penny stock, with the price for HCMC around 0.000535.

See price from MarketWatch.

2021-10-28_10-32-16_screenshot

clear && curl https://query1.finance.yahoo.com/v7/finance/quote?lang=en-US\&region=US\&corsDomain=finance.yahoo.com\&symbols=HCMC | python -m json.tool
{
    "quoteResponse": {
        "result": [
            {
                "language": "en-US",
                "region": "US",
                "quoteType": "EQUITY",
                "quoteSourceName": "Delayed Quote",
                "triggerable": false,
                "tradeable": false,
                "currency": "USD",
                "exchange": "PNK",
                "longName": "Healthier Choices Management Corp.",
                "messageBoardId": "finmb_61313402",
                "exchangeTimezoneName": "America/New_York",
                "exchangeTimezoneShortName": "EDT",
                "gmtOffSetMilliseconds": -14400000,
                "market": "us_market",
                "esgPopulated": false,
                "marketState": "PRE",
                "regularMarketDayRange": "5.0E-4 - 6.0E-4",
                "regularMarketDayLow": 0.0005,
                "regularMarketVolume": 999887103,
                "regularMarketPreviousClose": 0.0006,
                "bid": 0.0,
                "ask": 0.0,
                "bidSize": 0,
                "askSize": 0,
                "fullExchangeName": "Other OTC",
                "financialCurrency": "USD",
                "regularMarketOpen": 0.0005,
                "averageDailyVolume3Month": 552989394,
                "averageDailyVolume10Day": 564081527,
                "fiftyTwoWeekLowChange": 0.000485,
                "fiftyTwoWeekLowChangePercent": 9.7,
                "fiftyTwoWeekRange": "5.0E-5 - 0.0065",
                "fiftyTwoWeekHighChange": -0.005965,
                "fiftyTwoWeekHighChangePercent": -0.9176923,
                "fiftyTwoWeekLow": 5e-05,
                "fiftyTwoWeekHigh": 0.0065,
                "earningsTimestamp": 1620676800,
                "earningsTimestampStart": 1620676800,
                "earningsTimestampEnd": 1620676800,
                "epsTrailingTwelveMonths": -0.0,
                "sharesOutstanding": 333178994688,
                "bookValue": 0.0,
                "fiftyDayAverage": 0.0005827778,
                "fiftyDayAverageChange": -4.777778e-05,
                "fiftyDayAverageChangePercent": -0.08198284,
                "twoHundredDayAverage": 0.001051119,
                "twoHundredDayAverageChange": -0.00051611895,
                "twoHundredDayAverageChangePercent": -0.4910186,
                "sourceInterval": 15,
                "exchangeDataDelayedBy": 0,
                "regularMarketChange": -6.500003e-05,
                "regularMarketChangePercent": -10.833338,
                "regularMarketTime": 1635364796,
                "regularMarketPrice": 0.000535,
                "regularMarketDayHigh": 0.0006,
                "firstTradeDateMilliseconds": 946909800000,
                "priceHint": 4,
                "shortName": "HEALTHIER CHOICES MANAGEMENT CO",
                "marketCap": 178250768,
                "displayName": "Healthier Choices Management",
                "symbol": "HCMC"
            }
        ],
        "error": null
    }
}
achannarasappa commented 3 years ago

Thanks for sharing this request - I've added to the backlog for a future release. I've heard this request a couple times and I think it warrants addressing along with perhaps a few other crypto specific improvements.

ajgringo619 commented 1 year ago

Any updates on this request?

achannarasappa commented 1 year ago

On the large number end of the problem, I think this is handled with the scale suffix. Can you share an example / screenshot of this problem on the small number side? Is this for crypto or equities?

Scientific notation could be an option but also open to other suggestions for how to solve this.