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 111 views
1 answer 124 views
1 answer 136 views
1 answer 105 views
1 answer 121 views
1 answer 101 views
...