(1) currency() function

ie:
<script language="javaScript">
   var qty = 12
   var unitPrice=123.45
   var subtotal=qty*unitPrice
   document.myForm.subtotal.value=currency(subtotal)
</script>

(2) right-alignment link: http://www.developer.irt.org/script/205.htm

John



----- Original Message -----
From: "Hong" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, October 10, 2000 5:49 PM
Subject: OT: javascript function


> hi,
>
> in my form, i have several fields to display price in TEXTFIELD
>
> <INPUT TYPE="TEXT" VALUE="">
> The value will be set via a Javascript function when event "onclick"
> occurs.
>
> 2 questions:
>
> 1) how do i format the number into a dollar format (2 decimal places)
> using Javascript?
> eg.  225 should be displayed as 225.00
>
> 2) is there an easy way to align the number to the right?
>
> Thanks!
>
> Hong
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to