Link to home
Start Free TrialLog in
Avatar of JohnLucania
JohnLucania

asked on

Parameter 1 of function DollarFormat; must be a number

I have:

<B>Gift Amount</B> <CFPARAM name="form.Amount" default=0>
<CFIF session.myTransactionMode eq "addPayment" AND session.myPaymentID neq "">
$<cfinput name="myAmount" value="#Right(DollarFOrmat(form.Amount),Len(DollarFOrmat(form.Amount))-1)#" tabindex="#myTab#"
type="text" id="myAmount" size="10" class=notetext2 validate="regular_expression"  disabled
pattern="^\d+\.?\d{1,2}?$" message="Please double-check the Amount you entered!">
<INPUT type=hidden name=Amount value="#Right(DollarFOrmat(form.Amount),Len(DollarFOrmat(form.Amount))-1)#">
<CFELSE>
$<cfinput name="Amount" value="#Right(DollarFOrmat(form.Amount),Len(DollarFOrmat(form.Amount))-1)#" tabindex="#myTab#"      type="text" id="Amount" size="10" class=notetext2 validate="regular_expression"
pattern="^\d+\.?\d{1,2}?$" message="Please double-check the Amount you entered!">
</CFIF>

and I am getting:

Parameter 1 of function DollarFormat which is now 3,000.00 must be a number  
 
The error occurred in line 41

 
39 : <INPUT type=hidden name=Amount value="#Right(DollarFOrmat(form.Amount),Len(DollarFOrmat(form.Amount))-1)#">
40 : <CFELSE>
41 : $<cfinput name="Amount" value="#Right(DollarFOrmat(form.Amount),Len(DollarFOrmat(form.Amount))-1)#" tabindex="#myTab#"
42 : type="text" id="Amount" size="10" class=notetext2 validate="regular_expression"
43 : pattern="^\d+\.?\d{1,2}?$" message="Please double-check the Amount you entered!"

What is wrong with this?
 
Avatar of dgrafx
dgrafx
Flag of United States of America image

Why not just do #DollarFormat(form.amount)#?
What is it you are trying to do?
ASKER CERTIFIED SOLUTION
Avatar of dgrafx
dgrafx
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JohnLucania
JohnLucania

ASKER

Great!!!!