General purpose number formatting filter