CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: uknod

Search: Search took 0.02 seconds.

  1. Replies
    40
    Views
    32,040

    Re: INT Function Rounding Problems

    Yes but the question is why is 19.99 so different, to any other. Check this out.
    Dim x As Double

    subtotal = 29.99
    subtotal = subtotal * 100
    x = subtotal
    subtotal = Int(x)

    ...
  2. Replies
    40
    Views
    32,040

    Re: INT Function Rounding Problems

    I understand the floating point error, but why ONLY on 19.99 and not any other number?
  3. Replies
    40
    Views
    32,040

    Re: INT Function Rounding Problems

    You want wierd try this very simple INT

    Dim subtotal As Double
    Dim vat As Double
    subtotal = 12

    vat = 180
    vat = Int(vat)

    vat = subtotal * 0.15
Results 1 to 3 of 3





Click Here to Expand Forum to Full Width

Featured