As an alternative to using custom queries, views or extra APIs etc, you could create an extra field specifically for sorting, defined as a virtual column, eg:
right(concat('0000',
numberAsText),5)
… where numberAsText is your existing field. Obviously, you might have to tweak the expression but this would result in:
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00012
If defined as VIRTUAL as opposed to STORED, the extra field wouldn’t take any extra space. (I don’t know if this affects sorting speed.)