Help With Integer


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Help With Integer

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    27

    Help With Integer

    I am working on a calendar program. I am using a formula to calculate the start day of the month. The problem I have my user inputing a year using 4 digits for instance 1988. The formular however requires that the only the last 2 digits. I thought about simply subtracting 1900 but this calendar needs to work for multiple centureires. Is there someway of spliting up Integers? Maybe casting them to a string. I am open for suggestions and am thankful for any help. Thank you and Merry Christmas.

  2. #2
    Join Date
    Dec 2005
    Posts
    7
    just take the remainder of the year divided by 100.

    int year = 1988;
    year = year % 100;

    that sets year to 88.

    Hope that helps

  3. #3
    Join Date
    Dec 2005
    Posts
    27
    Thank you for your help have a happy holidays

Similar Threads

  1. call function for button
    By angela_quests in forum VB Classic
    Replies: 2
    Last Post: 04-13-2007, 04:57 AM
  2. Physical Address of the NIC
    By eduardoms in forum Security
    Replies: 2
    Last Post: 05-06-2005, 10:26 AM
  3. CopyFileEx API - NullReferenceException
    By Eric Immerman in forum .NET
    Replies: 7
    Last Post: 10-04-2002, 10:12 AM
  4. How long before the next version??
    By _CAG in forum .NET
    Replies: 146
    Last Post: 08-12-2002, 10:40 PM
  5. Trying to print a PDF File from VB
    By Kunal Sharma in forum VB Classic
    Replies: 2
    Last Post: 04-25-2000, 03:45 PM

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