RangeUnit

Displaying numerical values in a series of predefined units

Specs

LabelValue

Version

0.1.0 (updated on 2023-10-01)

Developer

Labii Inc.

Type

Column

Support Configuration

Yes

Support Readonly view

Yes

Support Edit view

Yes

Support Form view

Yes

Support Default value

Yes

Support Import

Yes

Allow multiple

Yes

Overview

The RangeUnit widget is a versatile tool designed to simplify data analysis by effortlessly displaying numerical values in a series of predefined units. This widget eliminates the challenges associated with manually converting between various units, streamlining the process and ensuring consistent and easily interpretable results. Whether you're working with measurements in different unit systems or need to present data in a user-friendly format, the RangeUnit widget provides a seamless solution, enhancing the efficiency and accuracy of data analysis tasks.

The RangeUnit widget conducts real-time unit conversions according to the specified scale and presents both the value and the corresponding unit accurately. For instance, when given a value of 10000, instead of displaying "10000 ul", the widget will show "10 ml".

Use case

  1. Use this widget to display the volume of samples with the unit of ul, ml, and L.

  2. Use this widget to display the volume of samples in a specific language with unit of 毫升, 微升,.

  3. Use the widget to display the weight of shipping package with the unit of g, kg.

  4. Use the widget to display the measurement of length in the unit of mm, cm, m.

  5. Use the widget to display amount of time in the unit of seconds, minutes, hours, etc.

  6. Use the widget to display file size in the unit of BP, MB, GB, TB, etc.

Configuration

For the widget to function correctly, you should supply a list of units that require conversion, organizing them in ascending order from the smallest to the largest.

  • Unit - Please list the units to be converted, arranging them from smallest to largest.

    • Unit - Unit name.

    • Scale - The scale of the given unit relative to the base unit. For instance, if the base unit is ul (microliters), use a scale value of 1000 for ml (milliliters). This scale value will facilitate unit conversion.

    • Start - The initial value within the range to be converted, which should be expressed in terms of the base unit value. For instance, if you wish to convert all values greater than 500 ul into 0.5 ml, please specify the start value as 500.

    • End - The concluding value within the conversion range, which should be denominated in terms of the base unit value. It is required to provide at least one of the starting or ending values.

  • Format - You can format the provided 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. Use cases include prefixing with money symbols such as '$' or '€'.

    • Format (suffix) - A string to append to a number. For example: 'mL'.

The converted Unit will overwrite the value of the Format (suffix).

Example

Here is the widget configuration for the volume column of the samples table: It converts values in the range of 0-1000 µL to µL, values from 1000 to 1000000 to mL, and any numbers larger than 1000000 to L.

{
    "unit": [
		{
			"end": 1000,
			"unit": "µL",
			"scale": 1,
			"start": 0
		},
		{
			"unit": "mL",
			"scale": 1000,
			"start": 1000,
			"end": 1000000
		},
		{
			"unit": "L",
			"scale": 1000000,
			"start": 1000000
		}
    ],
    "format_decimals": "2",
    "format_thousand": ","
}

Views

See the interface of the widget in the following views.

Readonly view

Readonly view display the values of the column.

Edit view

The Edit view is the interface that allows you to modify the value.

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

Number.

Default value

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

Default value can be any numbers.

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 numbers.

Last updated