Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    Brighton, UK
    Posts
    282
    Thanks
    1
    Thanked 0 Times in 0 Posts

    adding decimals and formatnumber together

    I have set a Dim that is:

    dim A = 0.5
    dim B = 0.5 but B i am using formatcurrency(dim B)

    when i try to compare the two it doesn't let me.. but when i compare a whole number i.e 1 2 3 4 5 my code works fine ?? but ones with 0.5 or 1.5 don't work !!

    any ideas why.. i have clng dim A and still nothing

    this is what i am doing

    if A = B then
    end if


    cheers
    <marquee>thanks</marquee>

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Have you tried to convert both values to a double?

    If CDbl(A) = CDbl(B)


  •  

    Posting Permissions

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