Granular interview question

create a function to convert units