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. Database & SysAdmin
  3. Database
  4. Help with Calculations

Help with Calculations

Scheduled Pinned Locked Moved Database
csharphelpasp-netdatabase
4 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.
  • V Offline
    V Offline
    Vimalsoft Pty Ltd
    wrote on last edited by
    #1

    I need your help . i have a spreadsheet In the Spread Sheet in the First line there is a field “Unit Type Total PQ”. That field is calculated from =F2*D2 and the value of F2 = 0.05 and D2 = 12 so Excel reports that the Field “Unit Type Total PQ” results into 0.56. If I take a CALCULATOR and multiply 0.05 * 12 I get 0.6 And if I go to SQL I get with this

    SELECT CONVERT(DECIMAL(10,2),0.05) * 12

    I get 0.60 Why is Excell giving me Incorrect values or how can i fix my SQL

    Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

    B P 2 Replies Last reply
    0
    • V Vimalsoft Pty Ltd

      I need your help . i have a spreadsheet In the Spread Sheet in the First line there is a field “Unit Type Total PQ”. That field is calculated from =F2*D2 and the value of F2 = 0.05 and D2 = 12 so Excel reports that the Field “Unit Type Total PQ” results into 0.56. If I take a CALCULATOR and multiply 0.05 * 12 I get 0.6 And if I go to SQL I get with this

      SELECT CONVERT(DECIMAL(10,2),0.05) * 12

      I get 0.60 Why is Excell giving me Incorrect values or how can i fix my SQL

      Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      Hi Vuyiswa Maseko, Excel by default remove zero number from decimal value, if you want to display decimal value with 2 numbers with separator then right click on cell and Format Cells.. option then select Number category, there you can see option decimal places, where you can set 2 or another decimal places.


      I Love T-SQL "VB.NET is developed with C#.NET" If my post helps you kindly save my time by voting my post.

      1 Reply Last reply
      0
      • V Vimalsoft Pty Ltd

        I need your help . i have a spreadsheet In the Spread Sheet in the First line there is a field “Unit Type Total PQ”. That field is calculated from =F2*D2 and the value of F2 = 0.05 and D2 = 12 so Excel reports that the Field “Unit Type Total PQ” results into 0.56. If I take a CALCULATOR and multiply 0.05 * 12 I get 0.6 And if I go to SQL I get with this

        SELECT CONVERT(DECIMAL(10,2),0.05) * 12

        I get 0.60 Why is Excell giving me Incorrect values or how can i fix my SQL

        Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

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

        Maybe your 0.05 is really 0.0466666666 ?

        V 1 Reply Last reply
        0
        • P PIEBALDconsult

          Maybe your 0.05 is really 0.0466666666 ?

          V Offline
          V Offline
          Vimalsoft Pty Ltd
          wrote on last edited by
          #4

          yes that is correct

          Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa[at]dotnetfunda.com http://www.Dotnetfunda.com

          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