Decimal number with "." and i would like ","

M

moi

Hello,
When user write a decimal number in a textbox with the numeric pad, he hits
the "." button but in FRANCE, we use the ",". How to change the "." in the
textbox with a "," ?
Example : user write "34.45" and i would like "34,45" to be in the database
(else i have a data type error) ...
Is there two method ? with or without autopostback ?
What's the best ?

Thanks a lot !
 
T

Teemu Keiski

Hi,

validators would make them enter it as expected- ;-)

Anyways, you could run javascript for example in onchange event (client) to
replace dot '.' with comma ','. Or you could just do string replace ins
erver-side code. it kind of also depends is it possible that you'd have
client browsers not letting you run js. Running it on the server is sure
way, but running it on the client also would better "indicate" to clients
what is expected.
 
P

prabhupr

You can use Regular Expression, to ensure only number [0-9] and "," is
allowed in that control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top