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 121 views
3 answers 222 views
1 answer 184 views
1 answer 93 views
2 answers 174 views
...