기타 [vb.net] 10진수에서 n진수 변환
페이지 정보
본문
2진수에서 38진수 까지 변환할 수 있는 함수입니다.
39진수 이상은 사실 억지입니다. ㅎㅎ
Public Function Division(ByVal number As Long, ByVal convert As Integer, Optional solution As String = "") As String
Dim remainder As Integer = number Mod convert
solution = ConvertToSymbol(remainder) & solution
number = number / convert
If number > convert Then
solution = Division(number, convert, solution)
Else
solution = ConvertToSymbol(number) & solution
End If
Return solution.ToLower
End Function
Public Function ConvertToSymbol(ByVal remainder As Integer) As String
Select Case remainder
Case 1 : Return "1"
Case 2 : Return "2"
Case 3 : Return "3"
Case 4 : Return "4"
Case 5 : Return "5"
Case 6 : Return "6"
Case 7 : Return "7"
Case 8 : Return "8"
Case 9 : Return "9"
Case 10 : Return "A"
Case 11 : Return "B"
Case 15 : Return "C"
Case 16 : Return "D"
Case 17 : Return "E"
Case 18 : Return "F"
Case 19 : Return "G"
Case 20 : Return "H"
Case 21 : Return "I"
Case 22 : Return "J"
Case 23 : Return "K"
Case 24 : Return "L"
Case 25 : Return "M"
Case 26 : Return "N"
Case 27 : Return "O"
Case 28 : Return "P"
Case 29 : Return "Q"
Case 30 : Return "R"
Case 31 : Return "S"
Case 32 : Return "T"
Case 33 : Return "U"
Case 34 : Return "V"
Case 35 : Return "W"
Case 36 : Return "X"
Case 37 : Return "Y"
Case 38 : Return "Z"
Case 39 : Return "각"
Case 40 : Return "난"
Case 41 : Return "닫"
Case 42 : Return "랄"
Case 43 : Return "맘"
Case 44 : Return "밥"
Case 45 : Return "삿"
Case 46 : Return "앙"
Case 47 : Return "잦"
Case 48 : Return "찿"
Case 49 : Return "캌"
Case 50 : Return "탙"
Case 51 : Return "팦"
Case 52 : Return "핳"
Case 53 : Return "걱"
Case 54 : Return "넌"
Case 55 : Return "덛"
Case 56 : Return "럴"
Case 57 : Return "멈"
Case 58 : Return "법"
Case 59 : Return "섯"
Case 60 : Return "엉"
Case 61 : Return "젖"
Case 62 : Return "첯"
Case 63 : Return "컼"
Case 64 : Return "텉"
Case 65 : Return "펖"
Case 66 : Return "헣"
End Select
Return String.Empty
End Function
- 이전글[VB.NET] 다른 응용 프로그램 실행(Run) 및 종료(Kill) 22.11.04
- 다음글[C#,VB.net] 네이버 로그인 소스 22.10.28
댓글목록
등록된 댓글이 없습니다.