Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com > ASP how to get the last digit of a number and add 1 to it?!

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 01-18-2010, 04:00 PM PM User | #1 jarv Banned   Join Date: Mar 2007 Posts: 1,523 Thanks: 116 Thanked 0 Times in 0 Posts how to get the last digit of a number and add 1 to it?! ok so I have 30568 in ASP how do i get the last digit eg here it is 8 Then I want to change this to a 9 by adding 1
 01-18-2010, 05:05 PM PM User | #2 FabriceB New Coder   Join Date: Jan 2010 Location: Montreal Posts: 32 Thanks: 2 Thanked 0 Times in 0 Posts Hi, I usually don't like to answer with another question but in this case I think it might help you get a jump start... When you found your answer for the example you provided, how did you go about it mathematically? Now... assuming you found that using mod, google is always your best option to find your answer (and this well before posting) ... That said, try the following search: asp mod function you should find exactly what you need from there! hope this helps! P.S.: I know you probably expected a direct answer to your question but this is fairly close to it, simply trying to help you find your answers more quickly and efficiently on your own... Have a nice day!
 01-18-2010, 08:30 PM PM User | #3 Old Pedant Supreme Master coder!     Join Date: Feb 2009 Posts: 24,968 Thanks: 75 Thanked 4,310 Times in 4,277 Posts I doubt seriously that Jarv found it mathematically, at all. I'm sure he just looked at the string of digits and picked out the last one. My question to Jarv is more fundamental: 30568 last digit is 8 bump it by 1 and it is 9 30569 last digit is 9 bump it by 1 and it is 10 Is *THAT* what you want???? Or do you want 30569 last digit is 9 bump it by 1 and it is 10, but then you only want the last digit of that so answer is 0. Is *THAT* what you want??? Finally, when you get the last digit bumped by 1, do you want to put it back on the end of the number??? That is, do you *REALLY* want 30568 ==>> 30569 30569 ==>> 30560 ??? __________________ An optimist sees the glass as half full. A pessimist sees the glass as half empty. A realist drinks it no matter how much there is.

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 06:22 AM.