How to separate double into integer and decimal in VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim f As Single = 98.27601F
        Dim s = f.ToString()
        Dim index As Integer = s.IndexOf(".")
		
        Console.WriteLine(s.Substring(0, index))
        Console.WriteLine(s.Substring(index))
    End Sub
End Class



' run:
'
' 98
' .27601
'

 



answered Jun 15, 2022 by avibootz

Related questions

1 answer 131 views
1 answer 119 views
3 answers 222 views
1 answer 227 views
227 views asked Nov 15, 2021 by avibootz
...