Skip to content
HALOWERK

Codewerk

units calc

Uses the mathjs unit system (SI and common imperial units, prefixes, derived units) to evaluate an expression or convert a value from one unit to another. Incompatible dimensions are rejected instead of silently converted. Expression functions that could alter the evaluator (import, createUnit, evaluate, parse, simplify, derivative) are disabled.

POST https://code.halowerk.com/v1/units-calc

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
expressionstringNoe.g. "5 km / 2 h to m/s" or "3 ft + 20 cm to cm"
valuenumberNo
fromstringNo
tostringNo
precisionintegerNo
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "expression": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "description": "e.g. \"5 km / 2 h to m/s\" or \"3 ft + 20 cm to cm\""
    },
    "value": {
      "type": "number"
    },
    "from": {
      "type": "string",
      "maxLength": 60
    },
    "to": {
      "type": "string",
      "maxLength": 60
    },
    "precision": {
      "type": "integer",
      "minimum": 1,
      "maximum": 15,
      "default": 10
    }
  }
}

Open original schema

Published input example

{
  "expression": "5 km / 2 h to m/s"
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’