Skip to main content

Quantity

Specs​

LabelValue
Version1.2.0 (updated on 2026-11-12)
DeveloperLabii Inc.
TypeColumn
Support ConfigurationYes
Support Readonly viewYes
Support Edit viewYes
Support Form viewYes
Support Default valueYes
Support ImportYes
Allow multipleYes

Overview​

The Quantity widget records a numeric value together with its unit in a single column, such as a volume, mass, or concentration. Users enter the number and pick the unit from a dropdown, so you no longer need a separate unit column next to a Number column.

Units are grouped by dimension, such as volume or mass. A column can use one or more dimensions, such as Volume and Mass concentration for test results, and you can limit it to the units your lab uses. Because every unit has a conversion factor, the widget can display a value in the most readable unit, for example 1500 µL as 1.5 mL. Units are only converted within the same dimension, so a volume is never converted into a mass.

Use case​

  1. Use this widget to record the volume of a sample in µL, mL, or L.
  2. Use this widget to record the concentration of a DNA or protein sample in ng/µL or mg/mL.
  3. Use this widget to record the molar concentration of a reagent in nM, µM, or mM.
  4. Use this widget with custom units to record counts such as cells or million cells.

Configuration​

For the widget to function correctly, select one or more Dimensions. The other options are optional.

  • Dimensions - The kinds of quantity users can choose units from. Select more than one when a column records different kinds of results, such as Volume and Mass concentration for test results. Units can only be converted within the same dimension. Defaults to Volume.
    • Volume - nL, µL, mL, L
    • Mass - pg, ng, µg, mg, g, kg
    • Mass concentration - pg/mL, ng/mL, ng/µL, µg/mL, µg/µL, mg/mL, g/L
    • Molar concentration - pM, nM, µM, mM, M
    • Percent - %
    • Count - EA (each), PR (pair, 2), DZ (dozen, 12), GR (gross, 144)
    • Custom - The units listed in Custom units.
  • Units - The units users can choose from. Leave empty to allow all units of the selected dimensions. Units that do not belong to the selected dimensions are ignored.
  • Default unit - The unit selected by default. Leave empty to select no unit.
  • Auto scale - Display the value in the most readable unit, such as 1500 µL as 1.5 mL. The stored value and unit are not changed.
  • Custom units - Required when the dimensions include Custom. List the units from smallest to largest.
    • Unit - The unit code, such as cells or vials.
    • Factor - The scale relative to the base unit, which has a factor of 1.
  • Constraints - Sets constraints on the number that can be entered. The constraints apply to the number as entered, in the selected unit.
    • Constraints (minimum) - The minimum number that can be entered.
    • Constraints (maximum) - The maximum number that can be entered.
  • Format - You can format the displayed number, learn more here https://refreshless.com/wnumb/
    • Format (decimals) - The number of decimals to include in the result. Limited to 7.
    • Format (mark) - The decimal separator. Defaults to '.' if thousand isn't already set to '.'.
    • Format (thousand) - Separator for large numbers. For example: ' ' would result in a formatted number of 1 000 000.
    • Format (prefix) - A string to prepend to the number.
    • Format (suffix) - A string to append to the number.
info

The unit is always displayed after the number, so you do not need to add it as a Format (suffix).

Example​

Here is the configuration for a sample volume column that allows µL and mL, selects mL by default, rejects negative values, and displays values with 2 decimals in the most readable unit.

{
"dimension": ["volume"],
"units": ["µL", "mL"],
"default_unit": "mL",
"should_auto_scale": true,
"constraints": {
"min": 0
},
"format": {
"decimals": 2
}
}

Here is the configuration for a cell count column with custom units.

{
"dimension": ["custom"],
"conversions": [
{"unit": "cells", "factor": 1},
{"unit": "million cells", "factor": 1000000}
]
}

Here is the configuration for a test result column that records either a concentration or a percentage, such as 25 ng/µL or 98.5 %.

{
"dimension": ["mass_concentration", "molar_concentration", "percent"]
}

Views​

See the interface of the widget in the following views.

Readonly view​

Readonly view displays the number followed by its unit, such as 12.50 mL. When Auto scale is enabled, the value is displayed in the most readable unit. In the example below, the stored value 30000 µL is displayed as 30 mL.

Widget column quantity readonly

Edit view​

The Edit view is the interface that allows you to modify the value. It has two fields:

  • Value - The number.
  • Unit - A dropdown of the units allowed by the column. The unit is optional.

Click Edit JSON to edit the data as JSON text instead.

Widget column quantity edit

Form view​

The Form view is the field integrated into the add form for collecting values when creating a new record.

The Form view is same as the Edit view.

Data​

Each widget in Labii stores data in a unique manner; refer below to understand how data from this widget is stored.

Data format​

JSON data with the number and the unit code. The unit code is stored as is and is not translated.

{
"value": 12.5,
"unit": "mL"
}

The unit is optional. A value without a unit, such as {"value": 12.5}, is displayed without a unit. In the Consumption widget it has a factor of 1, the same as the base unit of each dimension, such as µL or µg.

Default value​

The Default Value field within the column allows you to specify the default value when a record is created.

Default value shall be JSON text with the above keys.

{"value": 1, "unit": "mL"}

Import value​

The Import Value is the value you need to include in your Excel table for it to be imported into Labii.

Import value can be any of the following:

  • Number and unit - Such as 12.5 mL, 12.5mL, or 1,000 µL. Extra blanks are removed. The unit is matched to the units of the column regardless of case, and u is read as µ, so 5 ul is imported as 5 µL.
  • Number - Such as 12.5. The default unit of the column is used, or no unit when the column has no default unit.
  • JSON text - Such as {"value": 12.5, "unit": "mL"}.

Values that cannot be read, such as text without a number, are imported as the default value.