文档库 最新最全的文档下载
当前位置:文档库 › 将角度显示为度分秒以及转换计算

将角度显示为度分秒以及转换计算

将角度显示为度分秒以及转换计算
将角度显示为度分秒以及转换计算

MicroSoft FAQ Converting Decimal Degrees to Degrees/Minutes/Seconds Function Convert_Deg

onds Function Convert_Degree(Decimal_Deg) As Variant With Application 'Set degree to Integer o

ger of Argument Passed Degrees = Int(Decimal_Deg) 'Set minutes to 60 times the number to the right 'o

ght 'of the decimal for the variable Decimal_Deg Minutes = (Decimal_Deg - Degrees) * 60 'Set seconds t

nds to 60 times the number to the right of the 'decimal for the variable Minute Seconds = Format(((Minut

Minutes - Int(Minutes)) * 60), "0") 'Returns the Result of degree conversion '(for example, 10.46 = 10~ 27

0~ 27 ' 36") Convert_Degree = " " & Degrees & "° " & Int(Minutes) & "' " _ & Seconds + Chr(34) End With

With End Function Example: A1 =10.6 B1 = Convert_Degree(A1) Converting Degrees/Minutes/Seconds

conds to Decimal Degrees Function Convert_Decimal(Degree_Deg As String) As Double ' Declare the va

he variables to be double precision floating-point. Dim degrees As Double Dim minutes As Double Dim s

Dim seconds As Double ' Set degree to value before "°" of Argument Passed. degrees = Val(Left(Degree

egree_De

相关文档
相关文档 最新文档