Install
openclaw skills install wentianxe-calculatorPerform mathematical calculations and unit conversions. Use when the user needs to calculate expressions, convert units (length, mass, temperature, volume, a...
openclaw skills install wentianxe-calculatorPerform mathematical calculations and unit conversions.
python3 scripts/calculator.py calc "<expression>"
Supported operations:
+, -, *, /, %, ^ (or **)(2 + 3) * 450% → 0.5, 100 + 10% → 110Math functions:
sin(), cos(), tan(), asin(), acos(), atan()sinh(), cosh(), tanh()log() (natural), log10(), log2(), ln()sqrt(), pow(), exp()round(), floor(), ceil()abs(), max(), min(), factorial(), gcd()pi, edegrees(), radians()Examples:
python3 scripts/calculator.py calc "2 + 2"
python3 scripts/calculator.py calc "sin(pi/2)"
python3 scripts/calculator.py calc "sqrt(16) + log(10)"
python3 scripts/calculator.py calc "(100 - 20) * 1.5"
python3 scripts/calculator.py calc "2^10"
python3 scripts/calculator.py calc "50% of 200"
python3 scripts/calculator.py convert <value> <from_unit> <to_unit>
Supported categories:
| Category | Units |
|---|---|
| Length | m, km, cm, mm, mi, yd, ft, in, nm |
| Mass | g, kg, mg, lb, oz, t/ton |
| Volume | l, ml, gal, qt, pt, cup, fl oz, tbsp, tsp |
| Area | m², km², cm², ha, acre, ft², in² |
| Time | s, min, h, d, wk, mo, y |
| Temperature | °C, °F, K |
Examples:
python3 scripts/calculator.py convert 100 km miles
python3 scripts/calculator.py convert 70 f c
python3 scripts/calculator.py convert 2.5 kg lb
python3 scripts/calculator.py convert 500 ml cups
All commands output JSON:
{"result": 42}
{"result": 3.14159, "category": "length"}
{"error": "Division by zero"}
Common errors and their meanings:
Division by zero - Attempted to divide by zeroInvalid expression syntax - Malformed expressionUnknown function or variable - Used unsupported function/variableUnsupported unit conversion - Units not in same category or not recognized