@nicholasdly/subscript

A natural language parser and evaluator for unit conversion, time zone conversion, and basic math — zero dependencies and tree-shakeable.

npm install @nicholasdly/subscript

Demonstration

Enter a natural language query below and see how it's evaluated.

907.185 g
{
  "ok": true,
  "value": {
    "value": 907.18474,
    "unit": {
      "id": "gram",
      "symbol": "g"
    }
  },
  "text": "907.185 g"
}