# source: https://stackoverflow.com/a/63575958/2571881# adds leading zeros to numbers (binary or decinal)# tags: [math, numbers, zeros, utils]# autoloaded by my zsh confighow_many_bits=$1read number
zeros=$(($how_many_bits-${#number}))for((i=0;i<$zeros;i++));doecho -en 0done&&echo$number
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.