The 'str_printf'/'str_width' method that jcl said should work. I'm currently doing this through C#, rather than lite-c, so i'm using a workaround and it works fine.