In this paper, the Karush-Kuhn-Tucker theorem is used for finding the nearest triangular approximation of a fuzzy number with respect to a well-known metric, which preserves the centroid of the fuzzy number, is studied. The properties of translation invariance, scale invariance and identity of the triangular approximation operator are discussed. The main advantage is that the proposed triangular approximation operator preserves the centroid of fuzzy numbers, which is an important index for evaluating fuzzy numbers.