Hi All, I am trying to program a web based cash register/POS application. I would like to use a function to format the number in the "Amount Received" text box.
The idea I have in mind is to always keep two decimal places at all times.
For Example: if someone typed in 2000 it would automatically change that to 20.00
I would probably be triggering the function via onkeyup so it would actually change it on number at a time. 2->.02, 20->.20, 200->2.00, 2000->20.00 ect.
I know I could do it in php when processing the form, but I would really like the number to be already formatted when the form is submitted.
I have been trying to create my own function, but it is nowhere near working so I thought I'd ask if anyone here knows of an existing function or an easy way to accomplish what I am attempting to do.
Any help is appreciated. Thanks in advanced!