Convert units
convert_unitsConvert a number between two units of the same category and return a line such as "5 mi = 8.04672 km" (up to 10 significant digits). Units are matched by symbol or name, case-insensitive. Errors are returned for unknown units, units from another category, non-numeric values and temperatures below absolute zero. Months are 1/12 of a 365-day year. Units by category (symbols): length: m, km, mi, ft, in, cm, mm, yd, nmi; weight: kg, g, lb, oz, t, mg, st; temperature: °C, °F, K; volume: L, mL, gal, fl oz, cup, tbsp, m³; speed: km/h, mph, m/s, kn, ft/s; area: m², km², mi², ft², ac, ha; data: B, KB, MB, GB, TB, bit, KiB, MiB, GiB, TiB; time: s, min, h, d, wk, mo, yr, ms.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Unit symbol or name, e.g. mi or mile | |
| from | Yes | Unit symbol or name, e.g. km or kilometer | |
| value | Yes | A plain number such as 12.5, -40 or 1e6 (no commas or unit text) | |
| category | Yes | The kind of quantity; both units must belong to it |