Easy unit conversion by way of "Measurements"

I would like to propose a generalized format for unit conversions which is influenced by the iOS Shortcuts App.

Essentially, the Shortcuts app allows for a very simple conversion between different measurements of the same type.

This construct makes it very easy to work with varying units, like converting between units of Mass, Power, Speed, etc.

You can see a selection of some of the supported Measurement Types that they support, and you can see all of them if you download the app.

I can see this sort of thing being especially useful with units that are frequently changing, for example, file size units like Kb, Mb, Gb (as well as Kib, Mib, Gib, which are useful but often inconvenient to work with) are often most useful to list in their largest unit sizes. E.g. 5200 Mb is more parsimonious as 5.2Gb, .034 Mb as 34 Kb.

As far as implementation in Coda goes, I see this as a new Column Format similar to the Number Column Format where several Measurement Types are available.

E.g.
image

With this Measurement Type, it would be possible to implement a Convert() formula

Convert(measurement, unit)
Convert a measurement into the specified unit.

Convert(Measurement(10, "Gb"), "Mib" )76293.9

Ran into a bug today when converting between various units and I started thinking about this, figured I’d share.

Perhaps interestingly, this could provide a much higher level abstraction for the unit measurement tools that are already available like Date, Distance, etc. It wouldn’t replace them in any way, they are subsets of the Measurement type and would in theory be interoperable with Measurements of their same type.

It could also be the basis for supporting multiple currencies, which may be useful for certain users.

Anyway, the beautiful Coda team always astonishes me, so maybe they already have a solution for this, are working on something better, or have other plans, but any way it crumbles just wanted to share.

4 Likes