Almost all SolidWorks API methods are using system units which are MKS (meter, kilogram, second). For example SketchManager::CreateLine, Face2::GetArea, MassProperty::Mass. In my opinion this consistency is very important allowing to eliminate a lot of potential problems. However in some cases you need to take care about the conversion. For example when your macro or program expects user to input the value. And user expects to input the value in the unit system he is working on. The most common way of solving this issue is introducing custom units conversion system where your macro reading current user preferences and manages the table of conversion factors.
I'm going to introduce you to specific interface available in SolidWorks API which is dedicated to unit conversion. This is IUserUnit Interface
Let's take a quick look. Interface can be accessed through the ISldWorks::GetUserUnit or IModelDoc2::GetUserUnit. Later one automatically reads model unit settings and assign them to interface while first one needs to be initiated with the unit system.
It is also possible to change the digits, rounding options and padding for user units obtained from IModelDoc2 interface. You can also manage angular units in the same way as regular just specify ::GetUserUnit(swUserUnitsType_e.swAngleUnit)