Units for numer fields
Plain number fields can be highly ambiguous at times. E.g. does “width” mean
mm, or in
inch? When working in teams on the data, users entering data in the US might be more comfortable entering
inch and users in europe would prefer
This could be fixed by creating field types for length, area, volume etc. But this would lead to a whole host of field-types and would make it harder to extend further when incorperating more exotic cases like electrical current, temperature or units of time.
I would suggest to extend the
number field time with an optional parameter to set it’s unit.
User Input Conversion
The Default unit is the used for by the API to return entered value. When entering a Value in a different Unit it should automatically converted. The JSON output should still be a simple number. The API-Documentation should be extended to show information about the returned unit.
Mixed unit inputs like 6"2’ should automatically be turned into a decimal value.
A user could change the unit to show in the column, without changing the base unit of the API.
Conversion in API
The API could be extended with a request parameter, to retrieve number values in a prefered unit.
Formulas could be added, to work with units. E.G. Converting a given Unit into another (width-mm to width-inch). Or do calculate the Surface area by two given lengths.
- A merchand dealing in different Countries. Measures entered into one Column in a metric Unit automatically update the column for Imperial units.
- A property manager could enter the dimension of rooms in an apartment, automatically calculating the area of.
- Developers get a unambiguous about the meaning within a number field.
- Entering Temperature Data that is given in kelvin (K), celsius (degC), fahrenheit (degF)