(fix) Create initial format function

- simplify number/symbol functions;
- ret is now a string instead of an array;
(fix) Create initial format function

- throw an Error on invalid pattern instead of returning null;