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

fix: mteam api return float value, update int to toint #771

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TobiasYin
Copy link

mteam接口的数据返回格式有更新,对于一些字符串,返回了float 形式的 string。

            "readAccess": "255",
            "classUp": "0",
            "registerWeek": "0",
            "downloaded": "0",
            "shareRate": "0.0",
            "shareRateLimit": "0.0",
            "sortPoint": "1.0"

如果直接使用int("1.0"), 会报错:

int("1.0")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[2], line 1
----> 1 int("1.0")

ValueError: invalid literal for int() with base 10: '1.0'

将数字转换为 float,再转换为 int,解决这个问题 int(float("1.0")) == 1

@TobiasYin TobiasYin changed the title feat: update int to toint fix: mteam api return float value, update int to toint Aug 29, 2024
@fanyunxu
Copy link

TobiasYin 这个兄弟的修改后的代码可以统计馒头的量。 直接下载源文件 进行替换

@7-orion
Copy link

7-orion commented Nov 2, 2024

TobiasYin 这个兄弟的修改后的代码可以统计馒头的量。 直接下载源文件 进行替换

请问具体咋操作老哥

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.

4 participants