/
index
/
baseconv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
afc152e
)
todec: fix improper divider base
author
git
<redacted>
Fri, 20 Mar 2026 20:04:36 +0000
(16:04 -0400)
committer
git
<redacted>
Fri, 20 Mar 2026 20:04:36 +0000
(16:04 -0400)
todec
patch
|
blob
|
history
diff --git
a/todec
b/todec
index 7c582595a3c424f239a390d7e043cb0a6f90536e..1fd68bac51be4c1835edd0c71b36a8751e5d601a 100755
(executable)
--- a/
todec
+++ b/
todec
@@
-14,7
+14,7
@@
conv() {
printf "Hex %s → Decimal: " "$1"
fi
t=$(printf "%s" "$1" | sed 'y/abcdef/ABCDEF/; s/^0x//')
- printf "16i %s %s / p" "$t" "$k" | dc | tr -d '\n' && printf "%s\n" "$p"
+ printf "16i %s
2i
%s / p" "$t" "$k" | dc | tr -d '\n' && printf "%s\n" "$p"
else
printf "Error: '%s' is not a valid decimal or hexadecimal number\n" "$1" >&2