-
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.
-
just take the remainder of the year divided by 100.
int year = 1988;
year = year % 100;
that sets year to 88.
Hope that helps
-
Thank you for your help have a happy holidays
Similar Threads
-
By angela_quests in forum VB Classic
Replies: 2
Last Post: 04-13-2007, 04:57 AM
-
By eduardoms in forum Security
Replies: 2
Last Post: 05-06-2005, 10:26 AM
-
By Eric Immerman in forum .NET
Replies: 7
Last Post: 10-04-2002, 10:12 AM
-
Replies: 146
Last Post: 08-12-2002, 10:40 PM
-
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
Forum Rules
|
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
|
Bookmarks