Add decorator to assign units to function output.