---
title: parseQuantity
summary: Function in @sascom/commonjs.
order: 10
languages: [javascript]
sdk-package: JavaScript · @sascom/commonjs
---

# parseQuantity

[[page:reference/javascript/api|API catalogue]] · `@sascom/commonjs` · Function

````typescript sdk=js sdk-namespace="@sascom/commonjs"
function parseQuantity
````



## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/sascom-commonjs/parsequantity-8b29e2ff#member-sascom-commonjs-parsequantity-df388b06c0e6|parseQuantity]] | Method | Parses a quantity typed by a user: "60cm", "1,5 m", "5' 6 1/2\"", "1200/2", "90°". A comma between two digits is a decimal comma; values of one kind next to … |

## `parseQuantity` {#member-sascom-commonjs-parsequantity-df388b06c0e6}

````typescript sdk=js sdk-namespace="@sascom/commonjs"
parseQuantity(text: string, options?: QuantityOptions): ParsedQuantity | QuantityParseError
````

Parses a quantity typed by a user: "60cm", "1,5 m", "5' 6 1/2\"", "1200/2", "90°". A comma between two digits
is a decimal comma; values of one kind next to each other add up ("1 m 20 cm"); + - * / and brackets work.

### Parameters

| Name | Type | Description |
|---|---|---|
| `text` | `string` |  |
| `options` | [[page:reference/javascript/sascom-commonjs/quantityoptions-93bc2566|QuantityOptions]] |  |
