How to count the digits of a double value in Python

1 Answer

0 votes
d = 9812347.9085

dstr = str(d)

total_digits = len(dstr) - 1

print(total_digits)

 
 
 
'''
run:
 
11
 
'''
 

 



answered Jan 31, 2024 by avibootz

Related questions

1 answer 197 views
1 answer 216 views
1 answer 228 views
1 answer 190 views
1 answer 200 views
1 answer 173 views
...