Format a number with total number of digits
I used it to format a date as "yyyy-mm-dd"
Function pd(n, totalDigits)
if totalDigits > len(n) then
pd = String(totalDigits-len(n),"0") & n
else
pd = n
end if
End Function
' Example
' BBlogDate = pd(Year(BBlogDate),4) & "-" & pd(Month(BBlogDate),2) & "-" & pd(Day(BBlogDate),2)
if totalDigits > len(n) then
pd = String(totalDigits-len(n),"0") & n
else
pd = n
end if
End Function
' Example
' BBlogDate = pd(Year(BBlogDate),4) & "-" & pd(Month(BBlogDate),2) & "-" & pd(Day(BBlogDate),2)
n, totalDigits
BBlogDate = pd(Year(BBlogDate),4) & "-" & pd(Month(BBlogDate),2) & "-" & pd(Day(BBlogDate),2)
Views 2,861
Downloads 1,081
CodeID
DB ID
ANmarAmdeen
602
Revisions
v1.0
Saturday
December
29
2018