Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Documentation

Status
Not open for further replies.

ericksoda

Programmer
Oct 22, 2001
60
US
Does anyone know where the documentation is for the format function? I remember seeing some back in VB3 or so, but can't find a complete page for it now (and I can't find my VB3 docs).

Thanks.

David
 

' Returns current system time in the system-defined long time format.
MyStr = Format(Time, "Long Time")

' Returns current system date in the system-defined long date format.
MyStr = Format(Date, "Long Date")

MyStr = Format(MyTime, "h:m:s") ' Returns "17:4:23".
MyStr = Format(MyTime, "hh:mm:ss AMPM") ' Returns "05:04:23 PM".
MyStr = Format(MyDate, "dddd, mmm d yyyy") ' Returns "Wednesday,
' Jan 27 1993".
' If format is not supplied, a string is returned.
MyStr = Format(23) ' Returns "23".

' User-defined formats.
MyStr = Format(5459.4, "##,##0.00") ' Returns "5,459.40".
MyStr = Format(334.9, "###0.00") ' Returns "334.90".
MyStr = Format(5, "0.00%") ' Returns "500.00%".
MyStr = Format(&quot;HELLO&quot;, &quot;<&quot;) ' Returns &quot;hello&quot;.
MyStr = Format(&quot;This is it&quot;, &quot;>&quot;) ' Returns &quot;THIS IS IT&quot;.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top