Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Conversion Library

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Round Lake, IL
    Posts
    1,869

    Default Conversion Library

    Vincent,

    Here is a slight improvement for the Conversion Library.

    Code:
        Function KilometersToMiles Decimal decKilometers Returns Decimal
            Decimal decMiles
            
            //Move (decKilometers * 0.6214) to decMiles // this an approximation
            Move (decKilometers * 0.62137119223733) to decMiles // more accurate
            
            Function_Return decMiles
        End_Function
    Todd Forsberg
    Idealease, Inc.
    Senior Programmer

    Web and Mobile Development: Think Outside the <DIV>

  2. #2
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    10,075

    Default Re: Conversion Library

    That's as easy as pi

    [sorry, I couldn't help myself]
    Garret

    I ordered a chicken and an egg from Amazon.

    I'll let you know...

  3. #3
    Join Date
    Feb 2009
    Location
    Round Lake, IL
    Posts
    1,869

    Default Re: Conversion Library

    Ya... I know you Garret. LOL.

    The conversion multiplier in the Conversion Library was fine for short distances as an approximation, but when I tried to use it for Odometer readings on trucks that run multi 100K miles easy, then numbers were way off. So, I researched it. Hence, the improvement.
    Todd Forsberg
    Idealease, Inc.
    Senior Programmer

    Web and Mobile Development: Think Outside the <DIV>

  4. #4
    Join Date
    Feb 2009
    Location
    Round Lake, IL
    Posts
    1,869

    Default Re: Conversion Library

    It is good to share improvements even if I am the only one using this class library... LOL. Maybe others will too.
    Todd Forsberg
    Idealease, Inc.
    Senior Programmer

    Web and Mobile Development: Think Outside the <DIV>

  5. #5
    Join Date
    Feb 2009
    Location
    Somewhere in Vermont, USA - unless I'm not
    Posts
    10,075

    Default Re: Conversion Library

    I agree & your change is a good one. I just had to...
    Garret

    I ordered a chicken and an egg from Amazon.

    I'll let you know...

  6. #6
    Join Date
    Feb 2009
    Location
    Round Lake, IL
    Posts
    1,869

    Default Re: Conversion Library

    FYI: The class library I am referring too here is this:

    https://www.dataaccess.eu/resources/downloads/download-category/download-subcategory-842?dagapsg=25

    Specifically in the cLengthHandler class.
    Todd Forsberg
    Idealease, Inc.
    Senior Programmer

    Web and Mobile Development: Think Outside the <DIV>

  7. #7
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    9,614

    Default Re: Conversion Library

    Todd,

    Thanks and changed in GIT. It does bring up the question what to do with the other calculations in this class that use 4 digits?
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  8. #8
    Join Date
    Feb 2009
    Location
    Brazil
    Posts
    3,320

    Default Re: Conversion Library

    Increase the precision on all of them. As much as possible
    Samuel Pizarro

  9. #9
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    9,614

    Default Re: Conversion Library

    Samuel,

    Great, if you do have the numbers I am happy to add them to the library
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

  10. #10
    Join Date
    Feb 2009
    Location
    Brazil
    Posts
    3,320

    Default Re: Conversion Library

    https://www.angelfire.com/az/deaflab/measure.html

    This one provides 15 digs precision.
    Samuel Pizarro

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •