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 122 views
1 answer 134 views
1 answer 144 views
1 answer 113 views
1 answer 130 views
1 answer 109 views
...