Updated extension: Convert

The Convert extension is updated for Monterey. It also now displays the result as the button title, saving a click.

Requires PopClip 2021.11.

Full readme:

Convert

Convert quantities in metric units to US/imperial units, and vice-versa.

Convert-demo

Supports the following conversions: lb↔kg, oz↔g, miles↔km, feet/yards↔m, inches↔cm, °F↔°C.

The result will be shown as the action’s button title. Click the button to paste the result, or shift-click to copy it.

This is not a “scientific” converter, rather it attempts to parse the input as it might be encountered in ordinary writing, recipes, etc. Examples:

  • 5 km, 5km, 5k, 5K, 5 kilometres, 5 kilometers, all give the result 3.1 miles.

  • 2in, 2" and 2 inches all give 5.1 cm.

  • 80F, 80 °F and 80 fahrenheit all give 26.7 °C.

The output will attempt to match the number of decimal places of the input, so 5.000km will output 3.107 miles. (However, the output will always have at least one decimal place.)

Accepts either , or . as the decimal separator in the input. The output decimal separator will be according to the current system locale.

Does not accept numbers with thousdands separators in the input. (This would ne a nice improvement.)

Wikipedia links:

About

This is an extension for PopClip.

Requirements

Requires PopClip 2021.11.

Author

Nick Moore

Notes

This is a direct port of my original PHP code to TypeScript. I did look to see if there were any JavaScript libraries that did a similar thing, and I didn’t find any that replicated the behavior in quite the same way.

Changelog

v3 - Nov 4, 2021

  • Updated for macOS Monterey, rewritten in TypeScript.
  • Now displays the output in the button title itself.

v2 - 20 Oct 2020

  • Fix error on newer PHP versions.

v1 - 16 Apr 2013

  • Initial release (PHP).
1 Like

Thanks, Nick! You’re awesome.

1 Like

Greetings from Greece! I love your app, you’ve done an amazing job :slight_smile:
As for this extension, do you think it’s possible to add the “/” symbol for sizes as well? For example, a lot of people use 3/4" so that would really nice to have!

1 Like

So for example 3/4" as input would a output as 1.905cm you mean?

Yes, that’s right!! Or even just 1.9cm (similar to 2" = 5.1 cm). I’ts just a thought, as in my experience people use this type of measurements for inches (like 3/8", 5/8" etc), so I thought I should mention it! Again, I really love your app :slight_smile:

I can’t remember what precision the extension outputs (even though I wrote it)… I think you are right it is 2 significant figures isn’t it. You should know if you have been using it recently :slight_smile:

yes, it is 2 figures indeed - as I use it A LOT :laughing:

1 Like