SQLite function to format numbers with leading zeroes?
This can be accomplished with a little bit of magic using string concatenation and the substr function. Long story short, here’s what you want: select substr(‘0000000000’||’1234′, -10, 10) An explanation follows. First, know that SQLite’s string concatenation operator is ||. We’ll start by taking a string that is as long as the value we want … Read more