Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C Sharp only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C Sharp
How to validate decimal value in textbox using C#?
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
s k parimal
#1
How to validate decimal value in textbox using C#?
Nov 23 '10, 06:27 AM
How to validate decimal value in textbox using C#?
I am using this (^([0-9]*|\d*\d{1}?\d*) $)
but it not working
help
Dormilich
Recognized Expert
Expert
Join Date:
Aug 2008
Posts:
8694
#2
Nov 23 '10, 06:32 AM
you are aware that your regular expression could be simplified to
^\d*$
?
Comment
Post
Cancel
GaryTexmo
Recognized Expert
Top Contributor
Join Date:
Jul 2009
Posts:
1501
#3
Nov 23 '10, 03:43 PM
As an alternative to regular expressions, check out the double type's TryParse method.
Double.TryParse Method (System)
http://msdn.microsoft.com/en-us/library/3s27fasw.aspx
Converts the string representation of a number to its double-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment