Imports System
'
' FirstDigitAfterDecimal:
' -----------------------
' Extracts the first digit after the decimal point from a floating‑point number.
'
' Method:
' 1. Convert the number to a string.
' 2. Locate the decimal point.
' 3. Take the character immediately after it.
' 4. Convert that character to an integer.
'
' This uses familiar built‑in string functions and keeps the logic clear.
'
Public Class Program
Public Shared Function FirstDigitAfterDecimal(value As Single) As Integer
Dim s As String = value.ToString()
Dim dotIndex As Integer = s.IndexOf("."c)
Return Integer.Parse(s.Substring(dotIndex + 1, 1))
End Function
Public Shared Sub Main()
Dim f As Single = 7312.891
Dim digit As Integer = FirstDigitAfterDecimal(f)
Console.Write(digit)
End Sub
End Class
' run:
'
' 8
'