4 Replies Latest reply on Nov 1, 2013 4:41 PM by projay

# Period on getting placed in a number

### Title

Period on getting placed in a number

### Post

This script is setup for an email to the customer for the paid amount.  The period will get placed only if its not and exact dollar amount. for ex... \$13.25 will work but \$13.00 comes out as \$1300.  See pic below of the script and the email.

Thanks -J.

• ###### 1. Re: Period on getting placed in a number

I will need to add that on the bottom calc it works correctly whether it a whole number or number with cents. Its a mystery to me.

• ###### 2. Re: Period on getting placed in a number

Check the value of \$pmtamount

The only way I could get your results is if the value of N was text that included the period.

Let ( [ N = "5." ;
P = Position ( N ; "." ; 1 ; 1 )
] ;
Int ( N  ) & If ( P ; Left ( Mod ( N ; 1 ) & "0" ; 3 ) ; ".00" )
)

Produces 500

Let ( [ N = 5 ;
P = Position ( N ; "." ; 1 ; 1 )
] ;
Int ( N  ) & If ( P ; Left ( Mod ( N ; 1 ) & "0" ; 3 ) ; ".00" )
)

produces 5.00

• ###### 3. Re: Period on getting placed in a number

Try setting N to GetAsNumber ( \$PmtAmount )

and see if your calculation now works.

• ###### 4. Re: Period on getting placed in a number

Yep...getasnumber did the trick....now I won't get anymore calls from customers saying they paid me \$2000 when it was only \$20.

Thanks a bunch Phil.  You always come through!!!!!

-j