Add formatValue method