Format a variable