Port of FuelPHP's Formatter Class