How to count the number of digits in python and perl respectively The idea of the python guy is mathematically informative
import math
#Get the number of digits in data
data_size = int (math.log10(data) + 1)
# $Get the number of digits of x
$count = $x =~ tr/0-9/0-9/;
Recommended Posts