I'm trying to convert 2000000000012 to Java long object

JavaCast("long",long_var) fails saying it cannot fit it into an
"integer" (I wonder why it treats it as an integer)

And so I device my own UDF
<cfscript>
function toLong(inputVariable) {
  theLongInt = createObject("java","java.lang.Long");
  theLongInt = theLongInt.parseLong(toString(arguments.inputVariable));
  return theLongInt;
}
</cfscript>

That works for few large numbers. Sometimes it fails with following
message

Diagnostics: For input string: "2.00000000001E+012" null 
The error occurred on line 4.
Date and Time: 21/04/2005 16:24:34 

How should I tackle this.

Thanks in advance.

Warm Regards,
Sameer S. Kekade.
QUATRO FOUR RETAIL
"The right connections for your business"
Tel. direct  +61 2 9370 2775
Tel. direct  +61 2 9370 1062
Fax direct  +61 2 9370 1200 
Mobile 0409 156 038, 0411 566 650
[EMAIL PROTECTED]
www.quatro.com.au



---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to