Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: jonathanmI am trying to convert a double numeric value to a string from which I want to extract the first four characters as a string and using the following code:
testDate = InvPrintDate + 19000000
testStr = str(testDate)
if testDate == 0 then testStr = "00000101"
testYear = substr(testStr,0,4)
testMonth = substr(testStr,4,2)
InvprintDate is a 7 digit date in the form "cyymmdd". However, when I execute this the string being returned is in scientific notation, for example an InvPrintDate with a value of 1080923.0 returns a string of "2.00809e+007" with testYear and testMonth being "2.00" and "80" respectively.
Is there a way of forcing the "str" function to return the value "20080923"?
Thanks
Jonathan