Four is magic: Difference between revisions
m
→{{header|UNIX Shell}}
Line 2,194:
# check for easy case first - exclude exact powers of 10
# above 10 as we'll need to stick a "one" in front of those.
if [[ $n != *00 && -n ${names[$n]} ]]; then
printf '%s%s\n' "${names[$n]}" ${suffix:+" $suffix"}
Line 2,200:
fi
# find the largest power of 10 that
local -i i=0
local -i p=${powers_of_10[i]}
|