View Single Post
Old 02-15-2015, 11:53 AM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
You must use a second column, of type text. series_index is a builtin and contains data of type number (float I think), so the database will automatically remove the leading zeroes when storing it. The second column gets around that issue.

OTOH, that is indeed the correct way of changing which column you use to store the value.

So, what this script does is set the number of leading zeroes based on the highest series_index value in a particular series. If the series has books 1-9, no leading zeroes. If the series goes from 1-99, one leading zero for books 1-9. And so on.
eschwartz is offline   Reply With Quote