Short php class to handle different number formats