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

  • SEARCH
  • Home
  • 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 8913579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:29:53+00:00 2026-06-15T04:29:53+00:00

I have taken on the task of converting a very old classic ASP/VBScript/Access web

  • 0

I have taken on the task of converting a very old classic ASP/VBScript/Access web site to a “current” site. As you would suspect, most of it has been easier to just do-over, but there is a reporting page which relies on a bunch of calculations that aren’t documented so I just have to use his code/formulas but move them to C#.

Just for full disclosure, I imported the Access database to SQL Server with no issues. I used EntityFramewok PowerTools (Code First) to reverse engineer the new database and create my .edmx file. I noticed that when EntityFramework created the .edmx for me, it defined fields that are floats in the database as nullable Doubles (Double?) in the C# class…is there any risk of transposing, chopping, or changing the value in any way when converting float to nullable double?

The other spot that I think is suspect is in the rounding. Obviously the math around rounding hasn’t changed, but I wonder if VBScript and C# have any known differences in how they round.

So these lines in VBScript

varA1=oDataRs("boundData")
varB1i=varA1*3.0689
varB1=round(varB1i,3)

Becomes this is C#

var newVal = Math.Round(boundData.Value * 3.0689,3);

I am not converting anything to double or decimal, just working with it as it comes out of the database. I do have to use .Value though as I otherwise can’t multiply a Double? and a Double.

The values are very close, but off by about .036 on a pretty important piece of data, and I can’t find any reason why.

  • 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-06-15T04:29:54+00:00Added an answer on June 15, 2026 at 4:29 am

    In fact, both .NET and VB use the Banker’s Rounding algorithm, so you should get consistent results as long as you don’t specify MidpointRounding.AwayFromZero.

    The really interesting question is whether the source data in the Access database is a floating-point number, or a Currency column. If it’s Currency, then you should be using a decimal, not a double. That could cause small differences if the magnitudes of the numbers being multipled are sufficiently different.

    For the particularly important datum, what is the value of boundData?

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

Sidebar

Related Questions

I have taken the task of trying to get an older program to run
Off lately I have taken up the task to understand and learn C. Right
i have task which takes a parameter and has three modes of results Example
I have a task that takes a rather long time and should run in
I have been assigned wit the task to write a program that takes a
I have a task to do, I need to take data that has been
I have a task I need to perform, do_stuff(opts) , that will take ~1s
I have taken this little snippet straight out of some code I'm working on:
I have taken a manifest from one of the answers posted here in SO
I have taken over a project that was build from suggestions in this Dan

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.