cn-percentage-tool - 百分比计算器

v1.0.0

提供百分比计算、反向计算、比例计算和增减百分比功能,支持千分位和小数精度控制,纯Python实现。

0· 23·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for freedompixels/cn-percentage-tool.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "cn-percentage-tool - 百分比计算器" (freedompixels/cn-percentage-tool) from ClawHub.
Skill page: https://clawhub.ai/freedompixels/cn-percentage-tool
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install freedompixels/cn-percentage-tool

ClawHub CLI

Package manager switcher

npx clawhub@latest install cn-percentage-tool
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The code implements the described features (percent, from-part, of-part, change, formatting). No unexpected binaries, services, or credentials are required and the implementation uses only Python standard library functions, which aligns with the stated purpose.
Instruction Scope
SKILL.md usage examples reference running 'cn_percentage_tool.py' but the repository provides 'scripts/percentage_tool.py' — a documentation/packaging mismatch that may confuse users. Additionally, the formatting flag ignores the user-specified precision and always formats with two decimal places when formatted output is requested (format_number hardcodes ',.2f'); this is a functional bug but not a security issue. The runtime instructions do not read files, env vars, or contact external endpoints.
Install Mechanism
No install spec and no downloads; the skill is either used directly as a script or packaged separately. There is no remote code fetching or archive extraction.
Credentials
The skill requests no environment variables, credentials, or config paths. Nothing disproportionate is requested for the simple calculation functionality.
Persistence & Privilege
always is false and the skill does not request persistent system changes, modify other skills, or store credentials. It runs only when invoked.
Assessment
This skill appears safe and does what it claims: a small, self-contained percentage calculator in Python. Before using, note two minor issues: (1) the README examples refer to cn_percentage_tool.py while the provided script is scripts/percentage_tool.py — run the actual script path shipped in the package, and (2) when using the --formatted flag the output currently always shows two decimal places regardless of the --precision value (a functional bug, not a security issue). No credentials or network access are required. If you run untrusted code generally, consider executing it in an isolated environment (container/VM) — though for this script that is likely unnecessary.

Like a lobster shell, security has layers — review code before you run it.

latestvk974rctzc1g95bcxsk3ympaqts85m3y0
23downloads
0stars
1versions
Updated 6h ago
v1.0.0
MIT-0

cn-percentage-tool - 百分比计算器

纯 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 位小数

Comments

Loading comments...