I created two custom command such that I could get a properly formatted micro and nanometer suffixes without too much a hastle by using the siunitx package as follows:
\newcommand{\nm}{\si{\nano\meter} }
\newcommand{\um}{\si{\micro\meter} }
Normally the \si command incorporates spacing correctly when using it in a body of text, but when using my custom command I had to add a space at the end of it. Since it doesn't do that automatically when I use it in any bit of text. Which works, usually, but not when I use the command to end a sentence or put it before a comma. Maybe there is some kind of command structure which I am overlooking that takes care of this?

xspacepackage, and use it this way:\newcommand{\nm}{\si{\nano\meter}\xspace}->space is added only when needed. – ebosi Nov 30 '16 at 14:14free-standing-unitsoption. (Given the loss of semantic meaning and the risk of clashes for such short names, I'd favour sticking to the standard interface.) – Joseph Wright Nov 30 '16 at 14:22