【问题标题】:Why yahoo finance API returns quotes with fractions smaller than cents?为什么 yahoo Finance API 会返回分数小于美分的报价?
【发布时间】:2021-06-14 03:06:14
【问题描述】:

https://query1.finance.yahoo.com/v8/finance/chart/MSFT?period1=1623070800&period2=1623638698&interval=1d&includePrePost=False&events=div%2Csplits

我看到 yahoo Finance 返回的报价小于美分。我希望真正的报价以美分为单位。谁能告诉我一分钱是什么意思?

indicators": {
"quote": [
{
"close": [
253.80999755859375,
252.57000732421875,
253.58999633789062,
257.239990234375,
257.8900146484375
],
"open": [
249.97999572753906,
255.16000366210938,
253.80999755859375,
254.2899932861328,
257.989990234375
],
"low": [
249.80999755859375,
252.50999450683594,
253.2100067138672,
253.6699981689453,
256.6099853515625
],
"high": [
254.08999633789062,
256.010009765625,
255.52999877929688,
257.4599914550781,
258.489990234375
],
"volume": [
23079200,
22455000,
17937600,
24563600,
18995100
]
}
],
"adjclose": [
{
"adjclose": [
253.80999755859375,
252.57000732421875,
253.58999633789062,
257.239990234375,
257.8900146484375
]
}
]

【问题讨论】:

    标签: yahoo-finance


    【解决方案1】:

    可能是因为大多数小数在存储为二进制小数时无法准确表示。

    https://docs.python.org/3/tutorial/floatingpoint.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-18
      • 2021-10-30
      • 2015-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多