百分比转换工具 — 百分比转换器(Percentage Converter)
v1.2.5cn-percentage-tool。使用纯Python标准库,无需API Key。
0· 220·0 当前·0 累计
下载技能包
License
MIT-0
运行时依赖
无特殊依赖
安装命令
点击复制官方npx clawhub@latest install cn-percentage-tool
镜像加速npx clawhub@latest install cn-percentage-tool --registry https://cn.longxiaskill.com 镜像可用
技能文档
slug: cn-percentage-tool name: 百分比工具 description: "cn-percentage-tool。纯Python标准库,无需API Key。" keywords: percentage, tool version: "1.0.0" author: 千策
百分比工具 纯 Python 标准库实现的百分比计算工具。
功能
- 百分比计算:计算 A 是 B 的百分之多少
- 反向计算:已知百分比和部分,求整体
- 比例计算:已知整体和百分比,求部分
- 增减百分比:计算增长/下降百分比
- 格式化输出:带千分位分隔符和精度控制
使用方式 # 百分比:A 是 B 的百分之几 python3 cn_percentage_tool.py percent 25 200 # 输出:12.5% (25 占 200 的百分比) # 反向计算:已知百分比和部分,求整体 python3 cn_percentage_tool.py from-part 50 25 # 输出:200 (50 的 25% 是多少 → 50/0.25 = 200) # 比例计算:已知整体和百分比,求部分 python3 cn_percentage_tool.py of-part 200 25 # 输出:50 (200 的 25% 是多少) # 增减百分比:增长了多少 python3 cn_percentage_tool.py change 100 150 # 输出:50.0% (从 100 增长到 150) # 格式化精度 python3 cn_percentage_tool.py percent 1 3 --precision 4 # 输出:33.3333%
技术说明
- 纯 Python 标准库(argparse)
- 无外部依赖
- 默认精度 2 位小数