Effect of dimensionality on the charge-density wave in few-layer 2H-NbSe2