Skip to main content

CStr()

The CStr() will convert numeric and date values to a string format. 

Script

Converting a numeric (double) to a string.

Sub Main
    Dim aDouble As Double
    Dim aString As String
    aDouble = 34324.2345235
    aString = CStr(aDouble)
    MsgBox aString 'returns 34324.2345325
End Sub
Converting a date to a string.

Sub Main
    Dim aDate As Date
    Dim aString As String
    aDate = #09/09/2012#
    aString = CStr(aDate)
    MsgBox aString 'returns 09/09/2012
   
    aString = CStr(Now)
    MsgBox aString 'returns todays date and time
       
    aDate = #09/09/2012 12:10:00 AM#
    aString = CStr(aDate)
    MsgBox aString 'returns 09/09/2012 12:10:00 AM

End Sub

IDEAScript Language