Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 495973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:38:32+00:00 2026-05-13T05:38:32+00:00

I have a weird problem in asp.NET when calculating how many hours we need

  • 0

I have a weird problem in asp.NET when calculating how many hours we need to invoice.

In the below example, we have a total of 75,9 hours that need to be invoiced.
These hours are spread over several database rows (TimeIDs).

Basically, I always deduct the “amount_invoiced” from the “to invoice” hourly count:

TimeID:25433 - to invoice=75,9 - amount_invoiced=1
TimeID:25774 - to invoice=74,9 - amount_invoiced=1
TimeID:24688 - to invoice=73,9 - amount_invoiced=1,5
TimeID:24646 - to invoice=72,4 - amount_invoiced=2
TimeID:24890 - to invoice=70,4 - amount_invoiced=2
TimeID:25773 - to invoice=68,4 - amount_invoiced=2,25
TimeID:24455 - to invoice=66,15 - amount_invoiced=2,5
TimeID:25431 - to invoice=63,65 - amount_invoiced=2,5
TimeID:24552 - to invoice=61,15 - amount_invoiced=3
TimeID:24644 - to invoice=58,15 - amount_invoiced=3
TimeID:24727 - to invoice=55,15 - amount_invoiced=3
TimeID:25000 - to invoice=52,15 - amount_invoiced=4
TimeID:25195 - to invoice=48,15 - amount_invoiced=4,15
TimeID:24510 - to invoice=44 - amount_invoiced=4,5
TimeID:24419 - to invoice=39,5 - amount_invoiced=5
TimeID:25126 - to invoice=34,5 - amount_invoiced=5,5
TimeID:25064 - to invoice=29 - amount_invoiced=6,5
TimeID:24420 - to invoice=22,5 - amount_invoiced=7
TimeID:25251 - to invoice=15,5 - amount_invoiced=7,5
TimeID:24897 - to invoice=8,00000000000001 - amount_invoiced=8

Everything works ok, except for TimeID 24897.
Somehow the calculation of 15,5 – 7,5 = 8,00000000000001

I’m baffled as to why this would happen. Has anyone experienced a similar issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:38:32+00:00Added an answer on May 13, 2026 at 5:38 am

    Usual double internal storage problem. Been answered many, many times on this site (I’ve answered it more than once myself, and Mr Skeet has probably lost count). Example:

    Comparing double values in C#

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a weird problem. My query in C#/ASP.NET returns results 5 times. I
Having a weird problem. I'm testing an ASP.NET application I wrote that queries SQL
I have a weird problem in asp.net. I have a page in which I
I have a weird problem. I have a ASP.Net MVC 3 site, containing a
i have a weird problem ! i have ASP.NET website and i have a
Weired problem! ASP.NET Session expires instantly. In my web.config I have this session settings:
I have a weird problem that i can't figure out a solution for: I've
Hey guys, I have a weird problem. I have an update system that refreshes
I have a wierd problem with threading in an ASP.NET application. For some reason,
I have a weird problem with ExecuteQuery in that it isn't working when performing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.