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

Conversion

Scheduled Pinned Locked Moved C#
csharpdatabasehelp
8 Posts 7 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.
  • R Offline
    R Offline
    rowdykuttan
    wrote on last edited by
    #1

    Hi Everyone I need a help, i have a number for eg :- 9.5 i want it to be 9.05 while taking to database cause if use round of it will give 9.50 but i want 9.05. am using C# 2005. Thanks In Advance

    M L P 3 Replies Last reply
    0
    • R rowdykuttan

      Hi Everyone I need a help, i have a number for eg :- 9.5 i want it to be 9.05 while taking to database cause if use round of it will give 9.50 but i want 9.05. am using C# 2005. Thanks In Advance

      M Offline
      M Offline
      Matthew Cuba
      wrote on last edited by
      #2

      rowdykuttan wrote:

      I need a help, i have a number for eg :- 9.5 i want it to be 9.05 while taking to database cause if use round of it will give 9.50 but i want 9.05. am using C# 2005.

      Can you rephrase what you are trying to accomplish? Not sure I follow.

      It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

      P 1 Reply Last reply
      0
      • M Matthew Cuba

        rowdykuttan wrote:

        I need a help, i have a number for eg :- 9.5 i want it to be 9.05 while taking to database cause if use round of it will give 9.50 but i want 9.05. am using C# 2005.

        Can you rephrase what you are trying to accomplish? Not sure I follow.

        It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        It seems that he wants to redefine how mathematics works.

        Deja View - the feeling that you've seen this post before.

        P M 2 Replies Last reply
        0
        • P Pete OHanlon

          It seems that he wants to redefine how mathematics works.

          Deja View - the feeling that you've seen this post before.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Yes, but in what way?

          1 Reply Last reply
          0
          • P Pete OHanlon

            It seems that he wants to redefine how mathematics works.

            Deja View - the feeling that you've seen this post before.

            M Offline
            M Offline
            Matthew Cuba
            wrote on last edited by
            #5

            Pete O`Hanlon wrote:

            It seems that he wants to redefine how mathematics works.

            Thanks for the chuckle - that might just be the case. :) I wanted to give the author the benefit that it might just be a language issue, though.

            It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

            1 Reply Last reply
            0
            • R rowdykuttan

              Hi Everyone I need a help, i have a number for eg :- 9.5 i want it to be 9.05 while taking to database cause if use round of it will give 9.50 but i want 9.05. am using C# 2005. Thanks In Advance

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              double answer; if(dbNumber == 9.5) { answer = 9.05; return answer; }

              Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy The people in the lounge said I should google for the answer to a programming question but I do not know what search engine to use

              C 1 Reply Last reply
              0
              • L Lost User

                double answer; if(dbNumber == 9.5) { answer = 9.05; return answer; }

                Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy The people in the lounge said I should google for the answer to a programming question but I do not know what search engine to use

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                ROTFL !!!!

                Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                1 Reply Last reply
                0
                • R rowdykuttan

                  Hi Everyone I need a help, i have a number for eg :- 9.5 i want it to be 9.05 while taking to database cause if use round of it will give 9.50 but i want 9.05. am using C# 2005. Thanks In Advance

                  P Offline
                  P Offline
                  Paras Kaneriya
                  wrote on last edited by
                  #8

                  Hi, Try using this double d = 9.5; d = Math.Floor(d) + ((Math.Floor(d) + 1) - d) / 10;

                  Paras Kaneriya
                  The difference between genius and stupidity is that genius has its limits.

                  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