DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links