Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How does qt qtcreat-QString retain two decimal places?
How does qt qtcreat-QString retain two decimal places?
The static function number of QString can set the precision.

QString? QString::number(double? n,? Charles? Format? =? g ',? int? Accuracy? =? 6)

Return? Answer? String? Equivalence? Yes? That? Number? n,? Format? According to? Where to? That? Designated? Format? And then what? Precision. ? Do you see it? Arguing? Format? For what? Details.

Don't like? QLocale::toString(),? This? Function? Is it? Isn't it? Honor? That? User's? The scene? Setting methods of member functions setnum and arg. QString can also set the precision, and the precision parameter is the precision after the decimal point.