PHP, 2623 Bytes
<?=-~log10(abs($argn?:1));
log of base 10 of the absolute value plus one cast to int
for zero as input use onelog10 gives back INF
which is interpreted as false
The better way is to calculatereplace $argn
with $argn?:1
+3 Bytes
PHP, 27 Bytes
<?=strlen($argn)-($argn<0);
string length minus boolean is lower then zero
+2 Bytes for string comparision $argn<"0"
PHP, 32 Bytes
<?=preg_match_all("#\d#",$argn);
Regex count all digits
35 Bytes
<?=strlen($argn)-strspn($argn,"-");
string length minus count -