473,386 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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 !
Mar 10 '06 #1
3 1381
You can specify culture:

http://msdn.microsoft.com/library/de...ficculture.asp

HTH

Elton Wang

"moi" wrote:

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 !

Mar 10 '06 #2
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.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"moi" <me@me.me> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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 !

Mar 10 '06 #3
You can use Regular Expression, to ensure only number [0-9] and "," is
allowed in that control.

Mar 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
2
by: Carl G | last post by:
I am storing a 0.000 a System.Decimal in a DataRow. On retrieval the value is only 0 without the three decimal places. It looks like the Get property returns System.Decimal.Zero, but why???? I...
2
by: Steve Summit | last post by:
-----BEGIN PGP SIGNED MESSAGE----- It's often explained that the reason for some of the imprecision in C's definition is so that C can be implemented on different kinds of machines -- say, those...
3
by: Cybertof | last post by:
Hello, I would like to return the good single value from a string value in these cases : Convert.ToSingle("23,30"); Convert.ToSingle("23.30"); // Conversion Error !!! The result should be...
11
by: Pieter | last post by:
Hi, I'm having some troubles with my numeric-types in my VB.NET 2005 application, together with a SQL Server 2000. - I first used Single in my application, and Decimal in my database. But a...
3
by: ajaksu | last post by:
Hello c.l.p.ers :) Running long(Decimal) is pretty slow, and the conversion is based on strings. I'm trying to figure out whether there is a good reason for using strings like in decimal.py...
5
by: Franky | last post by:
Can a Decimal variable be set to "Not a Number" I've been looking in the help and can't find any reference to that. Thanks in advance
28
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I convert a Number into a String with exactly 2 decimal places?...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.