本文整理汇总了C++中AvmCore::doubleToString方法的典型用法代码示例。如果您正苦于以下问题:C++ AvmCore::doubleToString方法的具体用法?C++ AvmCore::doubleToString怎么用?C++ AvmCore::doubleToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AvmCore
的用法示例。
在下文中一共展示了AvmCore::doubleToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _numberToString
Stringp NumberClass::_numberToString(double dVal, int radix)
{
AvmCore* core = this->core();
if (radix == 10 || MathUtils::isInfinite(dVal) || MathUtils::isNaN(dVal))
return core->doubleToString(dVal);
if (radix < 2 || radix > 36)
toplevel()->throwRangeError(kInvalidRadixError, core->toErrorString(radix));
// convertDoubleToStringRadix will convert the integer part of dVal
// to a string in the specified radix, and it will handle large numbers
// beyond the range of int/uint. It will not handle the fractional
// part. To properly handle that, MathUtils::convertDoubleToString
// would have to handle any base. That's a lot of extra code and complexity for
// something the ES3 spec says is implementation dependent
// (i.e. we're not required to do it)
return MathUtils::convertDoubleToStringRadix(core, dVal, radix);
}