Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to validate decimal value

How to validate decimal value

Scheduled Pinned Locked Moved C#
helptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    indiaone
    wrote on last edited by
    #1

    Hi, In my programe i am one using datagrid. User can enter decimal value and i am validating the value. for that i am using RegulerExpression. (?!^0*$)(?!^0*\.+0)*$^\d{1,5}(\.+\d{1,2})?$ but this is not working it's giving error. Message "Invalid escape sequence" those are . and \ help me its arrgent. Thanks asif

    S A 2 Replies Last reply
    0
    • I indiaone

      Hi, In my programe i am one using datagrid. User can enter decimal value and i am validating the value. for that i am using RegulerExpression. (?!^0*$)(?!^0*\.+0)*$^\d{1,5}(\.+\d{1,2})?$ but this is not working it's giving error. Message "Invalid escape sequence" those are . and \ help me its arrgent. Thanks asif

      S Offline
      S Offline
      Sven Cipido
      wrote on last edited by
      #2

      Hi, A very good site for regex is Regular Expression Library[^]. If you search here for decimal you will find 93 regex samples. There's also a regex tester on it. Sven

      1 Reply Last reply
      0
      • I indiaone

        Hi, In my programe i am one using datagrid. User can enter decimal value and i am validating the value. for that i am using RegulerExpression. (?!^0*$)(?!^0*\.+0)*$^\d{1,5}(\.+\d{1,2})?$ but this is not working it's giving error. Message "Invalid escape sequence" those are . and \ help me its arrgent. Thanks asif

        A Offline
        A Offline
        Are Jay
        wrote on last edited by
        #3

        this is a really generic regex for a decimal value, ^\d*\.\d*$

        I'm listening but I only speak GEEK.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups