Jump to content
deanishe

Offline Unit Conversion Workflow

Recommended Posts

v3.3 also uses the decimal and thousands separators you've set to parse input.

 

Now, you exotic Euro-types can enter 12.000,56 or 32'783,30 etc. (depending on your settings), and the workflow won't throw up on your slippers.

Edited by deanishe

Share this post


Link to post

Moar updates. v3.5.1 now handles negative numbers and is smarter about the number of decimal places.


There's a CURRENCY_DECIMAL_PLACES override to set a different number of decimal places for currency conversions (for you Bitcoin types), and DECIMAL_PLACES is now a minimum, not a hard limit (by default). If DYNAMIC_DECIMALS is on (the default), the workflow will show as many decimal places as necessary (up to 10) for the result to be non-zero.

Share this post


Link to post

Hi @deanishe, thanks for the great workflow.

I have a request related to the significant digits of the converted quantity.

The variable DECIMAL_PLACES controls not only the displayed format in Alfred bar but also the quantity copied to the clipboard on pressing Enter.

E.g. `conv 2.3456 m km` will show a converted quantity `0.0023 kilometer` and copy 0.0023 on the clipboard.

 

I would prefer to have the displayed result controlled by the mentioned variable but to retain all significant digits in the quantity copied to clipboard (in my previous example 0.0023456).

 

Share this post


Link to post
On 2/14/2019 at 4:40 PM, johseb said:

I would prefer

 

Is there an objective reason why I should implement this change?

 

I don't really see the point myself. OTOH, I don't work seriously with numbers, so I'm always open to making justifiable changes.

Share this post


Link to post
On 2/22/2019 at 4:44 AM, deanishe said:

 

Is there an objective reason why I should implement this change?

 

I don't really see the point myself. OTOH, I don't work seriously with numbers, so I'm always open to making justifiable changes.

 

If you're doing calculation and need the correct number of significant figures, it's never a problem when a conversion has more than necessary. Otherwise, you can get rounding errors.

It would be useful it you could simply type the number without a keyword, and without a space on the unit ie.

 

4.1mm

 

Instead of stating that no destination or defaults set, it would be useful to list the most common conversions (ex.. in the US its very common to convert mm to inch, whereas mm to cm is rather easy for a person). Check out the default setup for Spotlight, I think it lists common conversions, with no keyword.

 

BTW, I only critique because the workflow is very cool and useful, thanks for it.

Share this post


Link to post
8 hours ago, khaoskosmos said:

If you're doing calculation and need the correct number of significant figures


The workflow only rounds the result if you tell it to.

 

8 hours ago, khaoskosmos said:

It would be useful it you could simply type the number without a keyword

 

That isn't really how workflows work.

 

8 hours ago, khaoskosmos said:

without a space on the unit

 

You don't need a space.

 

8 hours ago, khaoskosmos said:

the most common conversions

 

If you have any universally-useful suggestions, I'll definitely consider it. However, I'm generally against adding any presets like inches that are of no interest to most users.

 

In a choice between requiring American users to manually add acres, pounds, Fahrenheit etc. and requiring everybody else to manually delete them, everybody else wins.

Share this post


Link to post
14 hours ago, deanishe said:


The workflow only rounds the result if you tell it to.

 

 

That isn't really how workflows work.

 

 

You don't need a space.

 

 

If you have any universally-useful suggestions, I'll definitely consider it. However, I'm generally against adding any presets like inches that are of no interest to most users.

 

In a choice between requiring American users to manually add acres, pounds, Fahrenheit etc. and requiring everybody else to manually delete them, everybody else wins.

 

Thanks. I will look into modifying it myself for my own needs. Is Alfred not aware of a user's location setting?

Share this post


Link to post
4 hours ago, khaoskosmos said:

Is Alfred not aware of a user's location setting?

 

Alfred is (being a native application), but it doesn't share that information with workflows.

 

You can use the command defaults read -globalDomain AppleMetricUnits to ask whether the OS is set to use metric.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...