本文整理汇总了C++中settings::getShowDigits方法的典型用法代码示例。如果您正苦于以下问题:C++ settings::getShowDigits方法的具体用法?C++ settings::getShowDigits怎么用?C++ settings::getShowDigits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings
的用法示例。
在下文中一共展示了settings::getShowDigits方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: displayNumber
void displayNumber(bigNumber &bn, settings &user, bool exact, bool stats)
{
if (exact)
bn.printNumber();
else
{
int actualDigits = bn.getDigitCount() - (PRECISION-bn.getDecimalCount());
if (user.getPercent())
{
bn.printPercent(user.getRound());
}
else
{
bn.printNumber(user.getRound());
}
if (user.getShowDigits() && stats==true)
{
cout << endl;
cout << "Digits: ";
if (bn<1 && bn > -1 && bn != 0)
cout << actualDigits - 1;
else cout << actualDigits;
cout << "\nDecimal places: " << bn.getDecimalCount();
cout << "\nBase: " << bn.getBase();
}
}
}
示例2: modifySettings
//.........这里部分代码省略.........
setS.clear();
cout << "Turn off percentages? ";
std::getline(cin, setS);
if (setS=="yes" || setS=="y")
{
user.percentOff();
break;
}
else if (setS=="no" || setS=="n")
{
break;
}
else
{
cout << "Invalid entry" << endl << endl;
continue;
}
}
else
{
setS.clear();
cout << "Turn on percentages? ";
std::getline(cin, setS);
if (setS=="yes" || setS=="y")
{
user.percentOn();
break;
}
else if (setS=="no" || setS=="n")
{
break;
}
else
{
cout << "Invalid entry" << endl << endl;
continue;
}
}
}
for (;;)
{
setS.clear();
if (user.getShowDigits())
{
cout << "Hide number stats? ";
std::getline(cin, setS);
if (setS=="yes" || setS=="y")
{
user.showDigitsOff();
break;
}
else if (setS=="no" || setS=="n")
{
break;
}
else
{
cout << "Invalid entry" << endl << endl;
continue;
}
}
else
{
cout << "Show number stats? ";
std::getline(cin, setS);
if (setS=="yes" || setS=="y")
{
user.showDigitsOn();
break;
}
else if (setS=="no" || setS=="n")
{
break;
}
else
{
cout << "Invalid entry" << endl << endl;
continue;
}
}
}
cout << endl << endl;
}