BeeJ
3/30/2012 1:23:00 AM
How about?
Tested for 1920,1080 & 1080,1920 and 1080,1080 and various other
non-nice such as 1921,1080.
Seems to work.
Where did I screw up?
Public Function Ratio(l1 As Long, l2 As Long) As String
Dim ll1 As Long
Dim ll2 As Long
Dim lRem As Long
Dim lRemLast As Long
' for starters
ll1 = l1
ll2 = l2
lRem = ll1 Mod ll2
If lRem Then
Do
ll1 = ll2
ll2 = lRem
lRemLast = lRem
lRem = ll1 Mod ll2
Loop While lRem
End If
If lRemLast Then
Ratio = CStr(l1 / lRemLast) & ":" & CStr(l2 / lRemLast)
Else
Ratio = "1:1"
End If
End Function 'Ratio
--
Noah's Ark was built by amateurs,
The Titanic was built by professionals.
Row, row, row your boat gently down the stream ...
Life is but a dream!