Why do you need global variables? It is not a good design. You can put them into a class like
class Units
{
public:
static double km;
};
Units::km = 1000.0;//meters.
Anywhere you need it, you can access it by
double vari = a * Units::km;
Try to avoid global variables. Encapsulation is an advantage of OOD.