Use user's locale in cli
Make format function portable

fixes #18