Easy answer is you don't. The format of the calibre library is to be treated as a black box. Stop trying to peek under the skirts. See the calibre faqs for
Why doesn’t calibre let me store books in my own folder structure?
What you do with the filenames you export is up to you and any templates you may create.
The number is the bookid in the database for that library. As an example, it will be used when rebuilding the library database if the database gets corrupted.
As for the truncation, that is due to the maximum path lengths in many operating systems. For Windows, that would be 254 characters. Again, the database records the full title and you can see it in your exported files.
You don't like this? calibre is open source so feel free to modify it for your use.
You may also want to read the following message:
Want to change folder structure or file names in the Calibre library?. Nothing has really changed since it was written back in 2011.
Edit: Manichean's message is stickied in the Library Managment subforum.