Format Functions
These are a collection of functions used to format certain types of strings.
FormatCurrency([expr])
FormatNumber([expr])
Formats a number as currency, (or as a number with FormatNumber)
Example:
MsgBox(FormatCurrency(20000))
' A message box will popup with the text "$20,000.00"
MsgBox(FormatNumber(20000))
' A message box will popup with the text "20,000.00"
' A message box will popup with the text "$20,000.00"
MsgBox(FormatNumber(20000))
' A message box will popup with the text "20,000.00"
FormatDateTime([expr], [format])
Formats a date and/or time. See example for use of the [format] option
Example:
Dim a as String
a = FormatDateTime("02/16/2010 13:45")
' a = "2/16/2010 1:45:00 PM"
a = FormatDateTime("02/16/2010 13:45", 1)
' a = "Tuesday, February 16, 2010"
a = FormatDateTime("02/16/2010 13:45", 2)
' a = "2/16/2010"
a = FormatDateTime("02/16/2010 13:45", 3)
' a = "1:45:00 PM"
a = FormatDateTime("02/16/2010 13:45", 4)
' a = "13:45"
a = FormatDateTime("02/16/2010 13:45")
' a = "2/16/2010 1:45:00 PM"
a = FormatDateTime("02/16/2010 13:45", 1)
' a = "Tuesday, February 16, 2010"
a = FormatDateTime("02/16/2010 13:45", 2)
' a = "2/16/2010"
a = FormatDateTime("02/16/2010 13:45", 3)
' a = "1:45:00 PM"
a = FormatDateTime("02/16/2010 13:45", 4)
' a = "13:45"