當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WT_I18N::digits方法代碼示例

本文整理匯總了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&nbsp;BCE', WT_I18N::digits(-$this->y));
     } else {
         if ($this->new_old_style) {
             return WT_I18N::translate('%s&nbsp;CE', WT_I18N::digits(sprintf('%d/%02d', $this->y - 1, $this->y % 100)));
         } else {
             return WT_I18N::translate('%s&nbsp;CE', WT_I18N::digits($this->y));
         }
     }
 }
開發者ID:brambravo,項目名稱:webtrees,代碼行數:12,代碼來源:Julian.php

示例2: FormatLongYear

 protected function FormatLongYear()
 {
     return WT_I18N::digits($this->y);
 }
開發者ID:sadr110,項目名稱:webtrees,代碼行數:4,代碼來源:Calendar.php

示例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>';
}
開發者ID:brambravo,項目名稱:webtrees,代碼行數:38,代碼來源:functions_date.php

示例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>
開發者ID:brambravo,項目名稱:webtrees,代碼行數:31,代碼來源:statistics.php


注:本文中的WT_I18N::digits方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。