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.

7 Likes

This would be hugely helpful in a problem I am trying to solve. My goal is to create a recipe database with multiple units of measure based off a conversion table. For example, if Butter is entered into the table with a unit of measure of pounds, I would be able to use all other weight units of measure (oz/wt, grams, Kg, etc.)

1 Like

This could probably now be done with a Pack. Is there a measurements Pack out there yet?

1 Like

I believe this will increasingly be the position of the Coda mothership

1 Like

I took a swing at a Unit Conversion Pack a while back. Let me know if it helps your use case or you have feedback about possible enhancements!

1 Like