I've upgraded scripts to use Python 3
because macOS 12.3 dropped Python 2
. And I prefer to use a short version of command like dec
and bin
instead of decimal
and binary
.
Original README:
Number System Converter -- an Alfred extension
Author: Hans-Helge Bürger Date: 29. March 2017 Version: v2.4 Licence: Attribution 3.0 Unported (CC BY 3.0)
Download NSC v2.4
NSC is a little Alfred workflow to convert a number into another number system. I study computer science and therefore I daily deal with different number systems. The most common ones are probably binary
, octal
, decimal
, and hexadecimal
but I got tiered to calculate them by hand, calculator or a webpage. Alfred is only a key stroke away and so I started programming this workflow.
I started to learn Python and to pratice that the new Alfred 2 workflow is written in Python. So your welcome to send a pull request if you have any improvement done.
Like I mentioned above, you can convert numbers. In the first version I implemented binary
, decimal
, and hexadecimal
. And you can even convert any number from any system into another.
But how can I use NSC? It is really simple.
You call NSC with the different keywords (this is new in v2.0) and according the number you want to convert. E.g. if you want to convert a decimal number you just type decimal
and the number
. Alfred 2 will show instantly the converted number in binary
, octal
, and even hex
.
So the 4 basic keywords are:
decimal
binary
octal
hex
and it looks like that:
I really love this feature, displaying live updates in Alfred :)
Beside these 4 keywords a fifth is implemented: convert
. It is used if a number needs to be converted which is no to base 2, 8, 10 or 16. It uses the following syntax:
`convert` `number` `base of number` `base of new system`
Imagine it like a sentence: Convert number X with base B into system with base Y
Convert 42 with base 6 into system with base 4
Another cool feature of Alfred 2 is that you can pass arguments to other parts of your workflow. In case of NSC, if you select a result and click enter
, the number will be copied to your clipboard and a notification will pop up.
-
decimal 10
→ result: B: 1010 // O: 12 // H: a -
binary 1011
→ result: D: 11 // O: 13 // H: b -
octal 150
→ result: D: 104 // B: 1101000 // H: 68 -
hex FF2
→ result: D: 4082 // B: 111111110010 // O: 7762 -
convert 119 11 3
→ result: D: 141 // Base 3: 12020
- enhancement: add version to
info.plist
. Props to @bbezanson #5 #6
- add:
+
and/
to alphabeth for converting up to base 64. Props to @sycrat #4
- add: display binary numbers w/ at least 8 digits
- add: display hex in uppercase thx to akupila
- add: conversion upto base 62 (case-sensitive letters if base is greater than 35)
- add: add info.plist to repo
- add: all scripts uses now alp to generate XML feedback
- bug: base 1 led into an infinite loop (thx to @kevinlsw | #2)
- add: new int2base function which uses now letters as input/output within
convert
- add: NSC uses alp to generate XML feedback
- NSC is now an Alfred Workflow and works with Alfred 2
- add: convert from/into decimal, binary, octal, hex
- add: new keywords
decimal
,binary
,octal
,hex
andconvert
- add: update made easy with Alleyoop
- change GitHub link
- add: support for updater extension
- bug: minor bugfixes
- add: display letters if digits larger than 10
- add: convert to
decimal
with an own function - add: convert from
decimal
to other number system upto base 35
- add: convert between
binary
,deciaml
, andhexadeciaml
with PHP builtin functions
- first version of NSC
- add: can convert from
decimal
tobinary
andhexadecimal
with PHP builtin functions
- convert floating numbers
See LICENSE