Code Monkey home page Code Monkey logo

alfred-convert's People

Contributors

angristan avatar deanishe avatar olbrew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alfred-convert's Issues

Unknown unit ?

Hi there,

Every conversion I try, I get an 'unknown unit' error.
image

version 2.6 not compatible with Alfred 2

I'm still using Alfred 2 (v 2.9) and upon to use this workflow, it's suggesting me to use version 2.6.
After downloaded, it turned out this v2.6 also works with Alfred 3 only.

screen shot 2017-12-20 at 3 59 29 pm

United Arab Emirates Dirham

This is by far the best converter workflow I have come across and I have been looking for ages. Would be good if you could support more currencies including 'United Arab Emirates Dirham'.

Thanks!

Please add some basic oil & gas conversions

Oil barrel to cubic meter
1 bbl = 0.1589873 m^3

Ton to oil barrel (for average density oil)
1 ton = 7.1475121 bbl

Barrel of oil equivalent (BOE) to cubic meter
1 boe = 169.902 m^3

Barrel of oil equivalent (BOE) to Million Standard Cubic Feet
1 boe = 0.006 MMscf

Thanks!

Confusion with Plank's constant

Hello.

Great workflow. I noticed that I can't currently convert between km/h or mi/h and another unit of speed.

In my country kph is not common, we use km/h all the time.

I noticed the workflow is confusing this notation with a division involving the plank_constant.

It works if I use conv 32km/hour mi/hour.

Also can't do, for example, conv 5760h min.

In some cases, should h just be mapped to 1 hour?

Should we change this behavior or keep it? What do you think?

CRC is being used for 2 currencies

Costa Rican Colon (CRC) exchange rate is either completely off, or the workflow is using the CraftCoin (also CRC) currency when converting to CRC.

crc

Not working on OSX 10.11.2

I'm running mid 2014 13" MBP with OSX 10.11.2 and this plugin (downloaded from packal.org) is no longer functioning. I've attached a screenshot. It just sits in this mode and never does anything.

screen shot 2016-01-27 at 2 14 17 pm

Option to exclude unit when copying to clipboard

Great workflow thanks!

In most cases I only need the resulting number, not the unit, after doing a conversion. So would it be possible to add an option to specify that only the number is copied to the clipboard, without the unit?

Feature Request: Parse value in respect to delimiters in configs

Awesome workflow!

It's neat, that you can set different delimiters for the results, but I expected the configurations also to affect the input.

qty = float(''.join(qty))

I unsuccessfully tried using the Formatter on that value, but I don't know much about python. Guess it would need some conversion.

A nice solution would parse the number no matter what:

23.34 => 23.34
23,34 => 23.34
12.123,345 => 12123.345
12,123.345 => 12123.345

The only problem would be three decimal places:
23,345 => 23.345 / 23345.00 ???

And this does not considers all cases.

So using the configuration would be most convenient, I guess.

Area conversion error

Hi,

I was attempting a unit conversion and this works:

conv 10 m**2 sq_in which displays 15,500.03

but if you reverse it

conv 10 sq_in m**2 you get an error saying 'ascii' codec can't encode character 'u\xb2' in position 5: ordinal not in range(128)

Should I be using another unit name instead of m**2? The same thing happens if I use m^2.

Thanks!

Base conversion

Hi,
Would it be possible to convert between number bases? I'm thinking of decimal, hexadecimal, binary, etc, for "coding" purposes.
I looked at the default units and Pint docs, but I couldn't find anything about that. Is it possible to add a unit that call a python function maybe?
Thanks

How to edit "configuration sheet"

The help-guide wasn't very useful for me in trying to add the APP_KEY from Open Exchange Rates – I ended up opening the workflow and editing the .plist.

Clarification would be super helpful! :-)

Thanks!

Unknown unit: XRP

This should work since version 3.0, right?

Problem: XRP unit (Ripple coin) is not recognized.
Steps to reproduce: try to convert 1 XRP to another currency, for example, USD
Expected behavior: Should print converted amount (like in the case of BTC)

screen shot 2017-07-17 at 16 09 18

screen shot 2017-07-17 at 16 14 09

ModuleNotFundError: No module named 'cPickle'

[2017-12-17 09:17:42][ERROR: input.scriptfilter] Code 1: Traceback (most recent call last):  

File "convert.py", line 20, in <module>  

from workflow import Workflow3, ICON_WARNING, ICON_INFO  

File "/Users/Canor/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.5E09B0F2-1E7D-4131-8F98-A36B01C3707E/workflow/__init__.py", line 16, in <module>  

from .workflow import Workflow, manager  

File "/Users/Canor/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.5E09B0F2-1E7D-4131-8F98-A36B01C3707E/workflow/workflow.py", line 27, in <module>  

import cPickle  

ModuleNotFoundError: No module named 'cPickle'

this recently has come to my attention, since it suddenly stopped working obviously. Does alfred-convert require cPickle to be installed on System?

Thanks.

Fiat currency conversions not recognised

Appears as though fiats that were working in a prior release are no longer recognised.

Have verified they appear in active_currencies.

Running latest 3.2 from git. Removed workflow + leftover files, restarted Alfred, reinstalled, same result.

FIAT symbols tried from USD: AUD, NZD, ZAR.

Screenshots attached.

screenshot 2017-11-03 11 42 20

screenshot 2017-11-03 11 50 00

screenshot 2017-11-03 11 50 40

contextualize conversions

The problem is that pint uses distinct mapping while in reality there is some kind of ambiguity without a proper context.

For example: Does kn means kilo newton or knots? Does h mean hour or the Planck constant?

It would be great to evaluate the possible meaning of the source expression and the target expression. If there is a match in types it's very likely that's the context the user meant. Or even show the result of both if possible.

No way in hell I will remember I have to use kpm for km/h or knots instead of kn. It's hard to build up muscle memory for this.

I guess replacing the dictionary with units that I use could be an option. But so far I only found how to add new units. No problem to drop the Planck constant. But it would be sad to drop newton.

Include pint's spectroscopy (and other context) option(s)

Great tool! It would be really nice to also take advantage of the more advanced conversions already available in pint, such as converting between energy and length in the context of spectroscopy (e.g., 1 Å = 12398 eV for light).

.alfred3workflow should be .alfredworkflow?

Hi Dean,

Thanks for this plugin, I've been using it for years, and I was recently delighted to discover that you've added crypto conversions. Thanks!

Took me quite a while to figure out that I needed to rename the extension for it to install, is that deliberate?

How to add the API key?

This may sound quite stupid, but I'm staring at the documentation without understanding how do I add the openexchangerates API key I just created to the extension.

Do I need to edit manually the extension files? How so? thanks!

CPU spikes to 100%

After running a conversion, the CPU of the Python process spikes to 100% and stays there indefinitely on my Mac. This occurs after any conversion, like currency, or length.

I think this only started happening a few days ago. I already re-installed the workflow.

Use local decimal point setting

Hi,

is there a chance to make the workflow use the mac's local settings for the decimal point? While the US uses a "dot" many other countries use a "comma". Alfred's built in calculations adapt to the mac's regional settings, so it would be great if the workflow would that to, because it is confusing to use one here and the other one there. I always do it wrong the first time.

Again: Awesome extension. Thank you.
Julian

EDIT: Fixed my mistake

Updating exchange rates

These days i've noticed the following bug:

When i type conv 1 usd kzt it keeps telling my "Updating exchange rates" and i won't get actual data...

Currency converter broken

I'm suddenly not able to do all the currency conversions I'm used it. I've used the currency converter several times a day for years now, and it's suddenly failing to recognize my most used conversion, USD to CAD.

image

image

Feature Request: Period to Frequency

As a user of the convert alfred workflow I want to be able to convert from frequency (Hz) to a period back and forth.

// Period (T) to Frequency (Hz)

Input: conv 5 s Hz
Output: 0.2 Hz

Input: conv 0.25 s Hz
Output: 4 Hz

Input: conv 1 ms Hz
Output: 1000 Hz

// Frequency (Hz) to Period (T)

Input: conv 1000 Hz ms
Output: 1 ms

Error in workflow 'Convert' - Division by zero

After the last update v3.5.1, I can convert anymore the following error appear.

Error

Debug log
`Starting debug for 'Convert'

[2018-03-11 21:42:23][ERROR: input.scriptfilter] Code 1: 21:42:23 workflow.py:2247 DEBUG ---------- Convert (3.5.1) ----------
21:42:23 workflow.py:1657 DEBUG reading settings from /Users/Ray420/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred-convert/settings.json
21:42:23 workflow.py:2526 INFO checking for update ...
21:42:23 background.py:188 DEBUG [__workflow_update_check] command cached: /Users/Ray420/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/net.deanishe.alfred-convert/__workflow_update_check.argcache
21:42:23 background.py:192 DEBUG [__workflow_update_check] passing job to background runner: [u'/usr/bin/python', '/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/workflow/background.pyc', u'__workflow_update_check']
21:42:23 workflow.py:2247 DEBUG ---------- Convert (3.5.1) ----------
21:42:23 background.py:197 DEBUG [__workflow_update_check] background job started
21:42:23 convert.py:625 DEBUG query : 12 usd jpy
21:42:23 workflow.py:2411 DEBUG last run version: 3.5.1
21:42:23 convert.py:103 DEBUG version=3.5.1, last_version=3.5.1
21:42:23 workflow.py:1884 DEBUG loading cached data: /Users/Ray420/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/net.deanishe.alfred-convert/__workflow_update_status.cpickle
21:42:23 workflow.py:2461 DEBUG update_data: {u'available': False}
21:42:23 workflow.py:1884 DEBUG loading cached data: /Users/Ray420/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/net.deanishe.alfred-convert/exchange_rates.cpickle
21:42:23 convert.py:530 DEBUG registering currency : 'DZD = usd / 114.04071 = dzd'
21:42:23 convert.py:530 DEBUG registering currency : 'NAD = usd / 11.915 = nad'
21:42:23 convert.py:530 DEBUG registering currency : 'GHS = usd / 4.46 = ghs'
21:42:23 convert.py:530 DEBUG registering currency : 'EGP = usd / 17.641 = egp'
21:42:23 convert.py:530 DEBUG registering currency : 'BGN = usd / 1.58816 = bgn'
21:42:23 convert.py:530 DEBUG registering currency : 'LSK = usd / 0.05168 = lsk'
21:42:23 convert.py:530 DEBUG registering currency : 'PAB = usd / 1 = pab'
21:42:23 convert.py:530 DEBUG registering currency : 'BOB = usd / 6.910011 = bob'
21:42:23 convert.py:530 DEBUG registering currency : 'DKK = usd / 6.04549 = dkk'
21:42:23 convert.py:530 DEBUG registering currency : 'BWP = usd / 9.578914 = bwp'
21:42:23 convert.py:530 DEBUG registering currency : 'LBP = usd / 1512.5 = lbp'
21:42:23 convert.py:530 DEBUG registering currency : 'TZS = usd / 2254.1 = tzs'
21:42:23 convert.py:530 DEBUG registering currency : 'VND = usd / 22752.44336 = vnd'
21:42:23 convert.py:530 DEBUG registering currency : 'AOA = usd / 215.1155 = aoa'
21:42:23 convert.py:530 DEBUG registering currency : 'KHR = usd / 4002'
21:42:23 convert.py:530 DEBUG registering currency : 'QAR = usd / 3.641996 = qar'
21:42:23 convert.py:530 DEBUG registering currency : 'KYD = usd / 0.832789'
21:42:23 convert.py:530 DEBUG registering currency : 'LYD = usd / 1.33 = lyd'
21:42:23 convert.py:530 DEBUG registering currency : 'UAH = usd / 26.5275 = uah'
21:42:23 convert.py:530 DEBUG registering currency : 'JOD = usd / 0.709001 = jod'
21:42:23 convert.py:530 DEBUG registering currency : 'AWG = usd / 1.786505 = awg'
21:42:23 convert.py:530 DEBUG registering currency : 'SAR = usd / 3.75015 = sar'
21:42:23 convert.py:530 DEBUG registering currency : 'BND = usd / 1.321966 = bnd'
21:42:23 convert.py:530 DEBUG registering currency : 'HKD = usd / 7.830598 = hkd'
21:42:23 convert.py:530 DEBUG registering currency : 'CHF = usd / 0.93757 = chf'
21:42:23 convert.py:530 DEBUG registering currency : 'GIP = usd / 0.724428 = gip'
21:42:23 convert.py:530 DEBUG registering currency : 'XPF = usd / 96.875298 = xpf'
21:42:23 convert.py:530 DEBUG registering currency : 'XPD = usd / 38.77 = xpd'
21:42:23 convert.py:530 DEBUG registering currency : 'DASH = usd / 0.001649 = dash'
21:42:23 convert.py:530 DEBUG registering currency : 'MRO = usd / 356 = mro'
21:42:23 convert.py:530 DEBUG registering currency : 'HRK = usd / 6.038184 = hrk'
21:42:23 convert.py:530 DEBUG registering currency : 'DJF = usd / 177.075 = djf'
21:42:23 convert.py:530 DEBUG registering currency : 'THB = usd / 31.4465 = thb'
21:42:23 convert.py:530 DEBUG registering currency : 'XAF = usd / 532.515732 = xaf'
21:42:23 convert.py:530 DEBUG registering currency : 'XAG = usd / 0.06061195 = xag'
21:42:23 convert.py:530 DEBUG registering currency : 'ETB = usd / 27.56 = etb'
21:42:23 convert.py:530 DEBUG registering currency : 'UYU = usd / 28.40176 = uyu'
21:42:23 convert.py:530 DEBUG registering currency : 'NIO = usd / 31.085 = nio'
21:42:23 convert.py:530 DEBUG registering currency : 'LAK = usd / 8305 = lak'
21:42:23 convert.py:530 DEBUG registering currency : 'MAID = usd / 2.43 = maid'
21:42:23 convert.py:530 DEBUG registering currency : 'SYP = usd / 514.98999 = syp'
21:42:23 convert.py:530 DEBUG registering currency : 'MAD = usd / 9.2 = mad'
21:42:23 convert.py:530 DEBUG registering currency : 'MZN = usd / 61.855 = mzn'
21:42:23 convert.py:530 DEBUG registering currency : 'YER = usd / 250.325 = yer'
21:42:23 convert.py:530 DEBUG registering currency : 'ZAR = usd / 11.9234 = zar'
21:42:23 convert.py:530 DEBUG registering currency : 'NPR = usd / 104.297226 = npr'
21:42:23 convert.py:530 DEBUG registering currency : 'ZWL = usd / 322.355011 = zwl'
21:42:23 convert.py:530 DEBUG registering currency : 'NGN = usd / 360.5 = ngn'
21:42:23 convert.py:530 DEBUG registering currency : 'ANG = usd / 1.784194 = ang'
21:42:23 convert.py:530 DEBUG registering currency : 'CRC = usd / 569.71 = crc'
21:42:23 convert.py:530 DEBUG registering currency : 'AED = usd / 3.673014 = aed'
21:42:23 convert.py:530 DEBUG registering currency : 'GBP = usd / 0.724428 = gbp'
21:42:23 convert.py:530 DEBUG registering currency : 'MWK = usd / 725.725 = mwk'
21:42:23 convert.py:530 DEBUG registering currency : 'LKR = usd / 155.13 = lkr'
21:42:23 convert.py:530 DEBUG registering currency : 'DOP = usd / 49.13 = dop'
21:42:23 convert.py:530 DEBUG registering currency : 'PKR = usd / 110.65 = pkr'
21:42:23 convert.py:530 DEBUG registering currency : 'HUF = usd / 254.6475 = huf'
21:42:23 convert.py:530 DEBUG registering currency : 'BMD = usd / 1 = bmd'
21:42:23 convert.py:530 DEBUG registering currency : 'LSL = usd / 11.91 = lsl'
21:42:23 convert.py:530 DEBUG registering currency : 'MNT = usd / 2390.948643 = mnt'
21:42:23 convert.py:530 DEBUG registering currency : 'AMD = usd / 480.77 = amd'
21:42:23 convert.py:530 DEBUG registering currency : 'UGX = usd / 3648.3 = ugx'
21:42:23 convert.py:530 DEBUG registering currency : 'XDR = usd / 0.689644 = xdr'
21:42:23 convert.py:530 DEBUG registering currency : 'JMD = usd / 127.1499 = jmd'
21:42:23 convert.py:530 DEBUG registering currency : 'TTD = usd / 6.73915 = ttd'
21:42:23 convert.py:530 DEBUG registering currency : 'SHP = usd / 0.724428 = shp'
21:42:23 convert.py:530 DEBUG registering currency : 'AFN = usd / 69.475 = afn'
21:42:23 convert.py:530 DEBUG registering currency : 'MMK = usd / 1339.7 = mmk'
21:42:23 convert.py:530 DEBUG registering currency : 'KPW = usd / 900 = kpw'
21:42:23 convert.py:530 DEBUG registering currency : 'MKD = usd / 49.983876 = mkd'
21:42:23 convert.py:530 DEBUG registering currency : 'TRY = usd / 3.806784 = try'
21:42:23 convert.py:530 DEBUG registering currency : 'BDT = usd / 82.977763 = bdt'
21:42:23 convert.py:530 DEBUG registering currency : 'SJCX = usd / 0 = sjcx'
21:42:23 workflow.py:2266 ERROR division by zero
Traceback (most recent call last):
File "/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/workflow/workflow.py", line 2259, in run
func(self)
File "convert.py", line 645, in main
register_exchange_rates(exchange_rates)
File "convert.py", line 531, in register_exchange_rates
ureg.define(definition)
File "/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/pint/registry.py", line 233, in define
self._define(Definition.from_string(line))
File "/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/pint/definitions.py", line 57, in from_string
return UnitDefinition(name, symbol, aliases, value)
File "/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/pint/definitions.py", line 117, in init
converter = ParserHelper.from_string(converter)
File "/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/pint/util.py", line 417, in from_string
return cls._from_string(input_string)
File "/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/pint/compat/lrucache.py", line 129, in wrapper
result = user_function(*args, **kwds)
File "/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/pint/util.py", line 452, in _from_string
ret = build_eval_tree(gen).evaluate(cls.eval_token)
File "/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/pint/pint_eval.py", line 83, in evaluate
return bin_op[op_text](left, self.right.evaluate(define_op, bin_op, un_op))
File "/Users/Ray420/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.36A4E12B-412E-4E74-90C4-60B1FD3B8E86/pint/util.py", line 535, in truediv
new.scale /= other
ZeroDivisionError: division by zero
21:42:23 workflow.py:2268 INFO for assistance, see: https://github.com/deanishe/alfred-convert/issues
21:42:23 workflow.py:2289 DEBUG ---------- finished in 0.382s ----------`

Will not fetch currency 10.12.4

Have tried the Fixum workflow, it did not pickup anything.

macOS 10.12.5

Starting debug for 'Convert'

[2017-07-14 08:55:25][STDERR: input.scriptfilter] 08:55:25 workflow.py:2225 DEBUG    Workflow version : 2.6.0
08:55:25 workflow.py:1628 DEBUG    Reading settings from `/Users/chbuschmann/Library/Application Support/Alfred 3/Workflow Data/net.deanishe.alfred-convert/settings.json` ...
08:55:25 workflow.py:2509 INFO     Checking for update ...
08:55:25 background.py:170 INFO     Task `__workflow_update_check` is already running
08:55:25 convert.py:183 DEBUG    query : 10 eur nok
08:55:25 workflow.py:2444 DEBUG    update_data : None
08:55:25 background.py:170 INFO     Task `update` is already running
08:55:25 convert.py:126 DEBUG    quantity : 10.0 tail :  eur nok
08:55:25 convert.py:140 DEBUG    atoms : [u'eur', u'nok']  i : 0  q1 : eur  q2 : nok
08:55:25 convert.py:140 DEBUG    atoms : [u'eur', u'nok']  i : 1  q1 : eur nok  q2 : 
08:55:25 convert.py:232 CRITICAL Invalid query : Unknown unit : eur nok
08:55:25 convert.py:255 DEBUG    finished
08:55:25 workflow.py:2423 DEBUG    Set last run version : 2.6.0
08:55:25 workflow.py:2267 DEBUG    Workflow finished in 0.008 seconds.

skjermbilde 2017-07-14 kl 08 53 50

"Configuration Sheet" - where is it?

The documentation mentions a configuration sheet in which APP_KEY (for currency conversion) should be added. Where is that configuration sheet? An enigmatic [x] is all that can be found in the documentation...

Ability to specify default conversion target

For example, for me I would like to have all currency converted by default, if no other target specified, to USD. For weight, I would like to see everything in grams, etc, etc.

Feature request: Copy without separator

conv 1hr s shows 3,600 second in the UI and copies 3,600 to the clipboard.

I like that the UI shows the thousand groupings, however, often I'm converting units for programming, spreadsheets, etc. and in those situations I usually want the "raw" value.

An option to show the thousand separators in the UI but not copy them to the clipboard would be great. Final result would be:

conv 1hr s shows 3,600 second in the UI and copies 3600 to the clipboard.

Google finance

Hi, is it possible to choose between yahoo and google finance? Also is it possible to set how often currencies will sync?

Temperature abbrevations do not work

Hi, the Pint docs say in http://pint.readthedocs.org/en/latest/nonmult.html

The default definition file includes fahrenheits, celsius, kelvin and rankine
abbreviated as degF, degC, degK, and degR.

However, when I do (in 1.1 from http://www.packal.org/workflow/convert)

convert 11 degC degF

it gives me an error message:

Unknown unit : degc

The workaround is to type the long names:

convert 11 celsius fahrenheit

That does work, but is pretty long to type.

Otherwise, this is an awesome workflow. Thank you for the work you put into this.

Best,
Julian

Feature request: conversion between millimeter and pixel

When I hit conv 170 mm pixel, it says Can't convert from millimeter [length] to pixel [printing_unit]

Then I found a formula to convert between millimeter and pixel at the bottom of this page, and it works perfectly for me.

So, why not add this functionality into alfred-convert?

Insufficient decimal places for results lower than 1

This script should be extended to handle cases where the resulting conversion is lower than 1. Most common example would cryptocurrencies such as Bitcoin. Because the ration is so huge, and a single dollar is worth less than 0.0001 BTC, more decimal spaces are needed to properly display the resulting conversion.

In the current implementation, conv 1 USD BTC would result in 0.00 BTC, which is obviously incorrect. What the script should do instead is check whether the resulting conversion is lower than 1, and format the result using an alternate decimal places property. Say, MICRO_DECIMAL_PLACES.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.