27-06-18, 08:03 PM
(آخر تعديل لهذه المشاركة : 27-06-18, 08:24 PM {2} بواسطة silverlight.)
ممكن تستخدم كود مثل هذا لحساب غدد السنوات و عدد الأشهر المتبقية معا
طريقة الاستخدام
PHP كود :
Private Sub GetYears(months As Integer, ByRef years As Integer, ByRef remainingMonths As Integer)
If months > 0 Then
Dim x As Integer = Math.Truncate(months / 12)
If x >= 0 Then
years = x
End If
Dim y As Integer = months - (years * 12)
If y >= 0 Then
remainingMonths = y
End If
End If
End Sub
طريقة الاستخدام
كود :
Dim years As Integer = Nothing
Dim remainingMonths As Integer = Nothing
GetYears(23, years, remainingMonths)
Retired

