...

View Full Version : NUmber formatting in the form $1,234,567.89



murali1983
01-10-2007, 04:41 AM
Hi,

can u plz help me to get the below requirement....

initially my text box contains the the value $0.00,and user can enter a maximum of 9 digits

when user enters the input the output should be inthe form as shown below.


initial | userInput | OutPUt

$0.00 1 -> $0.01

$0.00 12 -> $0.12

$0.00 123 -> $1.23

$0.00 1234 -> $12.34

$0.00 12345 -> $123.45

$0.00 123456 -> $1,234.56

$0.00 1234567 -> $12,345.67

$0.00 12345678 -> $123,346.78

$0.00 123456789 -> $1,234,567.89

$0.00 .(dot as input) $0.00
$0.00 .1 $0.10
$0.00 .11 $0.11


once dot is entered in the text box maximum of 2 digits can be entered follwing the dot.
dot should be accepted only when there is space for two digits.

thnx
Murali.

whizard
01-10-2007, 06:34 AM
Try this:

http://javascript.internet.com/forms/currency-format.html

HTH
Dan



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum