本文整理汇总了C++中Converter::FloatToNdp方法的典型用法代码示例。如果您正苦于以下问题:C++ Converter::FloatToNdp方法的具体用法?C++ Converter::FloatToNdp怎么用?C++ Converter::FloatToNdp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Converter
的用法示例。
在下文中一共展示了Converter::FloatToNdp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EPSSetText
void Key::EPSSetText(const Options& draw, const Partition& part) const
{
textStrings.resize(part.values.size());
const Converter convert;
auto text = std::begin(textStrings);
if (draw.chart_colour == ChartColour::MASSEXCESSERROR)
{
auto low = convert.FloatToNdp(part.values[0].value, 1);
auto high = convert.FloatToNdp(part.values[1].value, 1);
*text = "1 TR (Stable \\() TotalWidth sh\n1 S (d) TotalWidth sh\n1 TR (m < ";
*text += low;
*text += " keV\\)) TotalWidth sh TestWidth\n";
std::advance(text, 1);
*text = "1 TR (Stable \\() TotalWidth sh\n1 S (d) TotalWidth sh\n1 TR (m > ";
*text += low;
*text += " keV\\)) TotalWidth sh TestWidth\n";
std::advance(text, 1);
*text = "1 S (d) TotalWidth sh\n1 TR (m < ";
*text += low;
*text += " keV) TotalWidth sh TestWidth\n";
std::advance(text, 1);
*text = "1 TR ( ";
*text += low;
*text += " keV < ) TotalWidth sh\n1 S (d) TotalWidth sh\n1 TR (m < ";
*text += high;
*text += " keV) TotalWidth sh TestWidth\n";
std::advance(text, 1);
int index = 1;
while ((text - std::begin(textStrings)) < static_cast<int>(part.values.size() - 1))
{
low = high;
high = convert.FloatToNdp(part.values[index + 1].value, 1);
*text = "1 TR (";
*text += low;
*text += " keV < ) TotalWidth sh\n1 S (d) TotalWidth sh\n1 TR (m < ";
*text += high;
*text += " keV) TotalWidth sh TestWidth\n";
std::advance(text, 1);
++index;
}
*text = "1 S (d) TotalWidth sh\n1 TR (m > ";
*text += high;
*text += " keV) TotalWidth sh TestWidth\n";
}
else if (draw.chart_colour == ChartColour::REL_MASSEXCESSERROR)
{
auto low = convert.FloatToExponent(part.values[0].value);
auto high = convert.FloatToExponent(part.values[1].value);
*text = "1 S (d) TotalWidth sh\n1 TR (m/m < ) TotalWidth sh\n";
*text += std::get<0>(low);
*text += " ";
*text += std::get<1>(low);
*text += std::get<2>(low);
*text += " exponent TestWidth\n";
std::advance(text, 1);
*text = std::get<0>(low);
*text += " ";
*text += std::get<1>(low);
*text += std::get<2>(low);
*text += " exponent printUnit ";
*text += std::get<0>(high);
*text += " ";
*text += std::get<1>(high);
*text += std::get<2>(high);
*text += " exponent TestWidth\n";
std::advance(text, 1);
int index = 1;
while ((text - std::begin(textStrings)) < static_cast<int>(part.values.size() - 1))
{
low = high;
high = convert.FloatToExponent(part.values[index + 1].value);
*text = std::get<0>(low);
*text += " ";
*text += std::get<1>(low);
;
*text += std::get<2>(low);
*text += " exponent printUnit ";
*text += std::get<0>(high);
*text += " ";
*text += std::get<1>(high);
*text += std::get<2>(high);
*text += " exponent TestWidth\n";
std::advance(text, 1);
++index;
}
*text = "1 S (d) TotalWidth sh\n1 TR (m/m > ) TotalWidth sh\n";
//.........这里部分代码省略.........