achannarasappa / ticker

Terminal stock ticker with live updates and position tracking

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Force x number of decimal places in prices

ajgringo619 opened this issue · comments

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).

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
    }
}

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.

Any updates on this request?

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.