How to count the digits of a double value in VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim d As Double = 9812347.9085
        
		Dim dstr As String = d.ToString()
        
		Dim total_digits As Integer = dstr.Length - 1
		
        Console.Write(total_digits)
    End Sub
End Class



' run:
'
' 11
'

 



answered Mar 3, 2024 by avibootz

Related questions

1 answer 113 views
3 answers 198 views
1 answer 179 views
1 answer 87 views
2 answers 157 views
...