Try
<CFIF Left(Field2,2) is "0.">
<cfset field2 = #Mid(field2,2,len(field2)-1)#>
Then output field2
-----Original Message-----
From: Scott Mulholland [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 12, 2001 1:33 PM
To: CF-Talk
Subject: Leading 0 in csv
I am building a csv file from a query:
<cfoutput>
<cfset NewFile = '#NewFile#' & '#Field1#,#Field2#,#Field3#,' & chr(10)>
</cfoutput>
Field2 is a text field in the database. Sometimes the value of the field is
a decimal, i.e. .123
When I output it to the csv it is coming through as 0.123 by default. When
I look at it in the db it is stored as .123
Any ideas how to remove the 0 when it is written into the .csv?
I have tried a few functions (NumberFormat, ToString, Ucase - hoping to fool
it into thinking it was a string ;) )
Any ideas?
Scott
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists