Adobe COLDFUSION 9 Manual page 1163

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
.NET type
Java type
System.Data.DataTable
System.DateTime
java.util.Date
decimal
java.math.BigDecima
l
System.Decimal
System.Object
Using decimal numbers
Use the
function to convert ColdFusion data into BigDecimal format before you pass the value to a .NET
JavaCast
function, as in the following example:
<cfset netObj.netFunc(javacast("bigdecimal","439732984732048"))>
ColdFusion automatically converts returned decimal and System.Decimal values to ColdFusion string
representations.
Ensuring decimal and date/time conversions
ColdFusion converts .NET decimal or System.Decimal types only if the proxy for System.Decimal is a value type proxy.
Similarly, it converts .NET System.DateTime values to ColdFusion Date-time values only if the proxy for
System.DateTime is a value type proxy. The ColdFusion server always uses value proxies when it generates these
proxies. If you use the JNBProxyGUI.exe tool to generate the proxy, however, make sure to generate the proxy for
System.Decimal as value type.
Converting data to System.Object type
When a .NET method specifies
as the argument type, and you want to pass primitive values as arguments to that method, use the
to identify the data conversion. Once ColdFusion knows the data type, it automatically converts to the appropriate
.NET type. Here is the table that describes the conversion rule from ColdFusion type to .NET type.
.NET Type
bool / System.Boolean
bool[] / System.Boolean[]
char / System.Char
char[] / System.Char[]
double / System.Double
double[] / System.Double[]
float / System.Single
float[] / System.Single[]
ColdFusion type
Query
Note: ColdFusion converts from .NET type to ColdFusion type only, it does not convert
ColdFusion Queries to .NET DataTables
Date/time
String representation of the decimal number.
For details on using decimal numbers, see
If a .NET argument is of type System.Object, ColdFusion Strings are converted directly.
Other types require using the
ColdFusion cannot convert System.object instances returned by .NET methods to
ColdFusion types, but you can access them using the Object methods.
For detailed information, see
(as opposed to a specific Object subclass, such as
System.Object
Type used in javacast
boolean
boolean[]
char
char[]
double
double[]
float
float[]
Last updated 8/5/2010
"Using decimal
numbers" on page 1158.
JavaCast
function.
"Converting data to System.Object
1158
type" on page 1158.
)
System.Boolean
function
javacast

Advertisement

Table of Contents
loading

Table of Contents