本文整理汇总了PHP中WT_I18N::digits方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_I18N::digits方法的具体用法?PHP WT_I18N::digits怎么用?PHP WT_I18N::digits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WT_I18N
的用法示例。
在下文中一共展示了WT_I18N::digits方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formatLongYear
protected function formatLongYear()
{
if ($this->y < 0) {
return WT_I18N::translate('%s BCE', WT_I18N::digits(-$this->y));
} else {
if ($this->new_old_style) {
return WT_I18N::translate('%s CE', WT_I18N::digits(sprintf('%d/%02d', $this->y - 1, $this->y % 100)));
} else {
return WT_I18N::translate('%s CE', WT_I18N::digits($this->y));
}
}
}
示例2: FormatLongYear
protected function FormatLongYear()
{
return WT_I18N::digits($this->y);
}
示例3: format_timestamp
function format_timestamp($time)
{
global $DATE_FORMAT, $TIME_FORMAT;
$time_fmt = $TIME_FORMAT;
// PHP::date() doesn't do I18N. Do it ourselves....
preg_match_all('/%[^%]/', $time_fmt, $matches);
foreach ($matches[0] as $match) {
switch ($match) {
case '%a':
$t = gmdate('His', $time);
if ($t == '000000') {
$time_fmt = str_replace($match, WT_I18N::translate('midnight'), $time_fmt);
} elseif ($t < '120000') {
$time_fmt = str_replace($match, WT_I18N::translate('a.m.'), $time_fmt);
} elseif ($t == '120000') {
$time_fmt = str_replace($match, WT_I18N::translate('noon'), $time_fmt);
} else {
$time_fmt = str_replace($match, WT_I18N::translate('p.m.'), $time_fmt);
}
break;
case '%A':
$t = gmdate('His', $time);
if ($t == '000000') {
$time_fmt = str_replace($match, WT_I18N::translate('Midnight'), $time_fmt);
} elseif ($t < '120000') {
$time_fmt = str_replace($match, WT_I18N::translate('A.M.'), $time_fmt);
} elseif ($t == '120000') {
$time_fmt = str_replace($match, WT_I18N::translate('Noon'), $time_fmt);
} else {
$time_fmt = str_replace($match, WT_I18N::translate('P.M.'), $time_fmt);
}
break;
default:
$time_fmt = str_replace($match, WT_I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt);
}
}
return timestamp_to_gedcom_date($time)->Display(false, $DATE_FORMAT) . '<span class="date"> - ' . $time_fmt . '</span>';
}
示例4:
echo " onclick=\"statusDisable('zas-grenzen-periode');";
echo '"><label for="z_sex">', WT_I18N::translate('gender'), '</label><br>';
echo '<input type="radio" id="z_time" name="z-as" value="302"';
if ($plotshow == "302") {
echo ' checked="checked"';
}
echo " onclick=\"statusEnable('zas-grenzen-periode');";
echo '"><label for="z_time">', WT_I18N::translate('date periods'), '</label><br><br>';
echo WT_I18N::translate('Date range'), '<br>';
echo '<select id="zas-grenzen-periode" name="zas-grenzen-periode">
<option value="1700,1750,1800,1850,1900,1950,2000" selected="selected">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, WT_I18N::digits(1700), WT_I18N::number(50)), '</option>
<option value="1800,1840,1880,1920,1950,1970,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 40, WT_I18N::digits(1800), WT_I18N::number(40)), '</option>
<option value="1800,1850,1900,1950,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 50, WT_I18N::digits(1800), WT_I18N::number(50)), '</option>
<option value="1900,1920,1940,1960,1980,1990,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 20, WT_I18N::digits(1900), WT_I18N::number(20)), '</option>
<option value="1900,1925,1950,1975,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 25, WT_I18N::digits(1900), WT_I18N::number(25)), '</option>
<option value="1940,1950,1960,1970,1980,1990,2000">', WT_I18N::plural('from %1$s interval %2$s year', 'from %1$s interval %2$s years', 10, WT_I18N::digits(1940), WT_I18N::number(10)), '</option>
</select>
<br><br>';
echo WT_I18N::translate('results:'), '<br>';
echo '<input type="radio" id="y_num" name="y-as" value="201"';
if ($plotnp == "201") {
echo ' checked="checked"';
}
echo '><label for="y_num">', WT_I18N::translate('numbers'), '</label><br>';
echo '<input type="radio" id="y_perc" name="y-as" value="202"';
if ($plotnp == "202") {
echo ' checked="checked"';
}
echo '><label for="y_perc">', WT_I18N::translate('percentage'), '</label><br>';
echo '</td>
</tr>