wolph / alfred-converter

Alfred unit converter is a smart calculator for Alfred with support for unit conversions to make it a bit comparable to the Google Calculator and Wolfram Alpha.
93 stars 15 forks source link

Some HEX numbers are not recognized #32

Closed YCHX closed 1 year ago

YCHX commented 3 years ago

Some numbers such as 0x1f, 0x2f,0x2F that begin with a number followed by F will not be recognized as a hex number. Here is the results:

Xnip-2021-05-21_14-14-58 Xnip-2021-05-21_14-15-06 Xnip-2021-05-21_14-15-16
wolph commented 3 years ago

It looks like the unit converter is a bit too eager indeed. I guess the entire unit conversion should be disabled for non-base-10 numbers. That's going to take a bit of work though :)

wolph commented 1 year ago

I've fixed it so the base conversion (hex, octal and binary) conversions happen before the unit parsing happens. So this should always work :)