any spaces?

if you have been using numberFormat() then the vale may be padded

steve

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Jason J.
Troughton
Sent: Friday, April 08, 2005 1:27 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Weird cfset behaviour


I have dumped the value to the screen and it had no decimals or commas...

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ayudh
Nagara
Sent: Friday, 8 April 2005 12:56 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Weird cfset behaviour




I think typelessness went out the window somewhat when CFMX moved to the
Java platform.

The multiplication form.amount * 100 is a math operation and produces a real
number represented something like 4500.0
You can dump/display this value to verify.
The payment gateway probably expects a numeric field without decimal point,
so throws it out. What you need to do is to pass the value
ToString(Int(form.amount * 100)) instead. This ensures you pass a string of
numbers with no decimal point to keep the payment gateway interface happy.

Regards: Ayudh


+----------------------------------------------------------------+
| SOAP is the glue! Hook up your server directly to your bank.   |
| Connect to VeriPay xServ, the Australian Payments Web Service. |
| Reliable, Secure, FAST: http://www.xilo.com/xserv              |
+----------------------------------------------------------------+

Jason J. Troughton wrote:
> I have a payment gateway that need a cent amount to be passed. I pass
> the dollar amount and times it by 100.
> <cfset amount = form.amount * 100>
> This returned a error from the payment gateway of 'the amount is not
> numeric'
> I changed the above cfset to:
> <cfset amount = form.amount & "00">
> and now the payment gateway is returning a successfull transaction.
> Can someone explain why they think the problem happened because I was
> under the impression that cf was typeless...
>
> Jason.


---
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/

---
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/



---
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