Converting ISBN-10 to ISBN-13

Author: Joe Maddalone

function isbn10toisbn13(isbn10)
	dim isbnARR(9)
		for i = 0 to 9
			isbnARR(i) = cint(mid(isbn10,i+1,1))
		next

	a = 9
	b = 7
	c = 8
	d = isbnARR(0)
	e = isbnARR(1)
	f = isbnARR(2)
	g = isbnARR(3)
	h = isbnARR(4)
	i = isbnARR(5)
	j = isbnARR(6)
	k = isbnARR(7)
	l = isbnARR(8)
	m = isbnARR(9)
	
	
	n = (a*1)+(b*3)+(c*1)+(d*3)+(e*1)+(f*3)+(g*1)+(h*3)+(i*1)+(j*3)+(k*1)+(l*3)
	o = 10-(n mod 10)
	isbn10toisbn13 = cstr("978" & left(isbn10,9) & o)
end function

If you enjoyed this post Bookmark it at del.icio.us

Comments


Leave a Comment

 

 







LATEST POSTS

Career Developers are Shitbags they are. Consolas Makes Me Geek-ier MS Consolas Font Abuse Things I Read Today and You Should Too Whilst searching for solutions I happened upon... Knowing What Your Client DOES NOT want it's not manipulation, its project management. Textpad Extreme I teach Textpad to play well with others.

ADS

MOST POPULAR

Multiple IEs in Windows Firefox Vs. The World Who Is Xperya? ActionScript Form Fields Quick Watermark IE 7 beta 2 standalone

IP Address Tool Chicago Web Design Free Text Messaging