View Single Post
Old 11-10-2012, 11:46 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,968
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Pepin33 View Post
Yes, you're right. That is. But my books have a "custom" identifier to identify every one. And the value for this identifier was generated as {'my_id:':'%08d'%book_id}.

Now, I want to save those books using the identifier, but I want to remove left zeros. And if you're thinking about using book_id instead of my_id, not, that doesn't work, because the books are translated to another library so now my_id is not the same as the book_id...
Off the top of my head
use Nested commands (program mode),:
convert the numeric string portion to a (integer)Number, then convert that back to a string. That should lose the leading zeros.
theducks is offline   Reply With Quote