|
-
Oct 30th, 2012, 04:51 PM
#1
Thread Starter
Junior Member
how to convert years into months into days
i want to convert my years and months into days.instead of display like 1 years 3 months and 4 days.i want to be display like 296.4Days equal to 296days.first it was able to covert like 36 days = 1 months6 days but now all i want to convert and add years months into days like 365 + 180 +8 days.stores that value and take the average. i have my code below.since i still not take the average value all i need is to convert back into days(years and month + days)
Public Function e(length As Integer ) As String
dim a As string=0
dim b As string=0
dim c As string=0
dim d As string =0
if e = 0 then
Return String.Empty
end if
if e >= 366 then
a=cstr(Math.Floor (e/ 365))
e =(e Mod 365 )
e =(a * 365)
a = cstr(e)
end if
if e>31Andalsoe<366 then
b=cstr (Math.Floor(e/ 30.4375))
e=e Mod 30.4375
e= (b * 30)
b=cstr(e
end if
if e< 31 Then
c =cstr(e)
end if
if e= 0 then
Return String.e
end if
Return(a+ "days" +b+ "days"+c+ "days") 'display in day not in years nd months
End Function
your help will be much appreciated
thanks in advance
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|