← 返回
效率工具 中文

Units

Perform unit conversions and calculations using GNU Units.
使用 GNU Units 执行单位换算和计算。
asleep123
效率工具 clawhub v1.0.0 1 版本 99958.7 Key: 无需
★ 1
Stars
📥 2,401
下载
💾 90
安装
1
版本
#latest

概述

GNU Units Skill

Use GNU units to perform unit conversions and calculations via the command line. Can be installed using brew and apt under "units".

Usage

Use the bash tool to run the units command. Use the -t (terse) flag to get just the numeric result.

units -t 'from-unit' 'to-unit'

Examples

Basic Conversion:

units -t '10 kg' 'lbs'
# Output: 22.046226

Compound Units:

units -t '60 miles/hour' 'm/s'
# Output: 26.8224

Temperature (Non-linear):

Temperature requires specific syntax: tempF(x), tempC(x), tempK(x).

units -t 'tempF(98.6)' 'tempC'
# Output: 37

Time:

units -t '2 weeks' 'seconds'

Rounding Output:

To round to specific decimal places (e.g. 3 places), use -o "%.3f":

units -t -o "%.3f" '10 kg' 'lbs'
# Output: 22.046

Definition Lookup:

To see what a unit definition is (without converting), omit the second argument (without -t is more verbose/useful for definitions):

units '1 acre'

Notes

  • Currency: units supports currency (USD, EUR, etc.), but exchange rates may be out of date as they are static in the definitions file.
  • Safety: Always quote your units to prevent shell expansion issues (e.g. units -t '1/2 inch' 'mm').

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 13:56 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Wrangler

asleep123
使用 Wrangler CLI 管理 Cloudflare Workers、KV、D1、R2 及 Secrets。适用于部署 Workers、管理数据库、存储对象或配置 Cloudflare 资源,涵盖 Worker 部署、KV 命名空间、
★ 7 📥 2,881
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 440 📥 148,158
productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 446 📥 226,466