本文整理汇总了PHP中CakeNumber::toPercentage方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeNumber::toPercentage方法的具体用法?PHP CakeNumber::toPercentage怎么用?PHP CakeNumber::toPercentage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakeNumber
的用法示例。
在下文中一共展示了CakeNumber::toPercentage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toPercentage
/**
* Formats a number into a percentage string.
*
* Options:
*
* - `multiply`: Multiply the input value by 100 for decimal percentages.
*
* @param float $number A floating point number
* @param int $precision The precision of the returned number
* @param array $options Options
* @return string Percentage string
* @see CakeNumber::toPercentage()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::toPercentage
*/
public function toPercentage($number, $precision = 2, $options = array())
{
return $this->_engine->toPercentage($number, $precision, $options);
}
示例2: toPercentage
/**
* @see CakeNumber::toPercentage()
*
* @param float $number A floating point number
* @param integer $precision The precision of the returned number
* @return string Percentage string
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::toPercentage
*/
public function toPercentage($number, $precision = 2)
{
return $this->_engine->toPercentage($number, $precision);
}