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. Web Development
  3. ASP.NET
  4. How to convert decimal ?

How to convert decimal ?

Scheduled Pinned Locked Moved ASP.NET
questiondatabasesql-serversysadminhelp
6 Posts 2 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.
  • K Offline
    K Offline
    King Shez
    wrote on last edited by
    #1

    HI guys i am facing problem, in my application i am using data type decimal, when i get the value from data base and show in text box if the value is e.g. 99 it shows 99.00000 as i have specified 5 after precision in sql server, how can i convert the 99.00000 to 99 can any one let me know about it thankx in advance.

    H 1 Reply Last reply
    0
    • K King Shez

      HI guys i am facing problem, in my application i am using data type decimal, when i get the value from data base and show in text box if the value is e.g. 99 it shows 99.00000 as i have specified 5 after precision in sql server, how can i convert the 99.00000 to 99 can any one let me know about it thankx in advance.

      H Offline
      H Offline
      Herman T Instance
      wrote on last edited by
      #2

      Convert.ToInt32(DecimalValue) or lblValue.Text = decimalValue.ToString("#,#0"); or txtValueBox.Text = decimalValue.ToString("#,#0");

      K 1 Reply Last reply
      0
      • H Herman T Instance

        Convert.ToInt32(DecimalValue) or lblValue.Text = decimalValue.ToString("#,#0"); or txtValueBox.Text = decimalValue.ToString("#,#0");

        K Offline
        K Offline
        King Shez
        wrote on last edited by
        #3

        thansk for your answer but in case if there is 99.45 in database it converts it back to 99 in this case i want to show 99.4, kindly reply ASAP.

        K 1 Reply Last reply
        0
        • K King Shez

          thansk for your answer but in case if there is 99.45 in database it converts it back to 99 in this case i want to show 99.4, kindly reply ASAP.

          K Offline
          K Offline
          King Shez
          wrote on last edited by
          #4

          thanks for your answer but in case if there is 99.45 in database it converts it back to 99 in this case i want to show 99.45, kindly reply ASAP.

          H K 2 Replies Last reply
          0
          • K King Shez

            thanks for your answer but in case if there is 99.45 in database it converts it back to 99 in this case i want to show 99.45, kindly reply ASAP.

            H Offline
            H Offline
            Herman T Instance
            wrote on last edited by
            #5

            "#,#0.##"

            1 Reply Last reply
            0
            • K King Shez

              thanks for your answer but in case if there is 99.45 in database it converts it back to 99 in this case i want to show 99.45, kindly reply ASAP.

              K Offline
              K Offline
              King Shez
              wrote on last edited by
              #6

              thanks i have did it, thanks for ur help.

              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