rounding


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: rounding

Hybrid View

  1. #1
    RAFrede Guest

    rounding


    I have apayroll check calculation that is gross to net. however there is
    a need to round to dollars/cents. tried rounding to 2 decimals - property
    = currency etc I think these functions may be in the wrong place. In form
    load?? In the cmdcalculate??

  2. #2
    Rick Rothstein Guest

    Re: rounding

    I think you should store your numbers in variables declared as Currency. Now
    that holds 4 decimal places which I think you should leave. When you display
    the number, round it for display at that point using Format$(YourValue,
    "currency") or Format$(YourValue, "$0.00") depending on your version of VB
    (substituting your local currency symbol in the 2nd form of Format$ if
    required).

    Rick

    "RAFrede" <rafoakland@worldatt.net> wrote in message
    news:392ed4fb$1@news.devx.com...
    >
    > I have apayroll check calculation that is gross to net. however there is
    > a need to round to dollars/cents. tried rounding to 2 decimals - property
    > = currency etc I think these functions may be in the wrong place. In

    form
    > load?? In the cmdcalculate??




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center