Ready for it?  ColdFusion is a typeless language!  This means you don't
have worry about whether it is a string or not.  In fact both numbers
and strings (among others) are all stored as a java.lang.String on the
back end.  When you go to perform a numeric operation on a variable,
ColdFusion casts it for you.

Your code below will work fine.

~Brad

-------- Original Message --------
 Subject: adding a deciamal point in front of a number
 From: j s <[email protected]>
 Date: Fri, August 28, 2009 4:05 pm
 To: cf-talk <[email protected]>
 
 
 What would be the best way to add a decimal point in front of number,
say 20 to .20?
 
 <cfset myNum = "20">
 <cfset newNum = "." & myNum>
 <cfoutput>#newNum#</cfoutput>
 
 Is this ok? If I need to do calculations will I have issues with newNum
because it's a string?
 
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325840
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to