本文整理汇总了PHP中sfCultureInfo::setNumberFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP sfCultureInfo::setNumberFormat方法的具体用法?PHP sfCultureInfo::setNumberFormat怎么用?PHP sfCultureInfo::setNumberFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfCultureInfo
的用法示例。
在下文中一共展示了sfCultureInfo::setNumberFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: simplify
$t->isa_ok($c->getDateTimeFormat(), 'sfDateTimeFormatInfo', '->getDateTimeFormat() returns a sfDateTimeFormatInfo instance');
// ->setDateTimeFormat()
$t->diag('->setDateTimeFormat()');
$d = $c->getDateTimeFormat();
$c->setDateTimeFormat('yyyy');
$t->is($c->getDateTimeFormat(), 'yyyy', '->setDateTimeFormat() sets the sfDateTimeFormatInfo instance');
$c->DateTimeFormat = 'mm';
$t->is($c->getDateTimeFormat(), 'mm', '->setDateTimeFormat() is equivalent to ->DateTimeFormat = ');
// ->getNumberFormat()
$t->diag('->getNumberFormat()');
$c = new sfCultureInfo();
$t->isa_ok($c->getNumberFormat(), 'sfNumberFormatInfo', '->getNumberFormat() returns a sfNumberFormatInfo instance');
// ->setNumberFormat()
$t->diag('->setNumberFormat()');
$d = $c->getNumberFormat();
$c->setNumberFormat('.');
$t->is($c->getNumberFormat(), '.', '->setNumberFormat() sets the sfNumberFormatInfo instance');
$c->NumberFormat = '#';
$t->is($c->getNumberFormat(), '#', '->setNumberFormat() is equivalent to ->NumberFormat = ');
// ->simplify()
$t->diag('->simplify()');
class myCultureInfo extends sfCultureInfo
{
public static function simplify($array)
{
return parent::simplify($array);
}
}
$array1 = array(0 => 'hello', 1 => 'world');
$array2 = array(0 => array('hello'), 1 => 'world');
$array3 = array(0 => array('hello', 'hi'), 1 => 'world');