Implement truncate function
Merge pull request #2 from khia/truncate_and_format

Implement truncate function