CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
convert variable to $00.00?



Feb 14, 2000, 9:21 AM

Post #1 of 2 (1766 views)
convert variable to $00.00? Can't Post

I'm using javascript to calculate totals for a bookstore. We want to submit Total to a credit card company but their program will not accept variable names, only 00.00 format. We use a .pl script to submit the data and generate response emails.
How do you convert the variable "Total" into the actual value (eg. $100.00) so it can be submitted like this:
<input type=hidden name="amt" value="100.00" >
I've seen this done with .pl shopping cart programs but can't figure out how they're doing it.


Feb 18, 2000, 12:20 AM

Post #2 of 2 (1766 views)
Re: convert variable to $00.00? [In reply to] Can't Post

in your code that displays the form you simply put the variable name in the value field.

<input type="hidden" name="amt" value="$amount">

Now when you run your script the form will be displayed as:

<input type="hidden" name="amt" value="100.00">


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives