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. smallmoney

smallmoney

Scheduled Pinned Locked Moved ASP.NET
question
3 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.
  • P Offline
    P Offline
    pickron
    wrote on last edited by
    #1

    How can I get rid of the value of 3000.0000 since its datatype is money ? I would like it to be 3000, not 3000.0000. The code is: Dim pMoney As SqlParameter = New SqlParameter("@Money", SqlDbType.Money, 8) pMoney.Value = Trim(CInt(txtMoney.Text)) cmdUpdate.Parameters.Add(pMoney) Did I overlook something ? Thanks!

    M 1 Reply Last reply
    0
    • P pickron

      How can I get rid of the value of 3000.0000 since its datatype is money ? I would like it to be 3000, not 3000.0000. The code is: Dim pMoney As SqlParameter = New SqlParameter("@Money", SqlDbType.Money, 8) pMoney.Value = Trim(CInt(txtMoney.Text)) cmdUpdate.Parameters.Add(pMoney) Did I overlook something ? Thanks!

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Hi there. The SqlDbType.Money type by definition has an accuracy to the 10,000th of a currency unit. If you are always working with integer types, you could use SqlDbType.Int instead, or you can always leave your data in the currency type, and format it (by rounding for example) upon display.

      P 1 Reply Last reply
      0
      • M Mike Ellison

        Hi there. The SqlDbType.Money type by definition has an accuracy to the 10,000th of a currency unit. If you are always working with integer types, you could use SqlDbType.Int instead, or you can always leave your data in the currency type, and format it (by rounding for example) upon display.

        P Offline
        P Offline
        pickron
        wrote on last edited by
        #3

        Thanks, Mike.

        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