当前位置: 首页>>代码示例>>PHP>>正文


PHP nf函数代码示例

本文整理汇总了PHP中nf函数的典型用法代码示例。如果您正苦于以下问题:PHP nf函数的具体用法?PHP nf怎么用?PHP nf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了nf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     // Check file exists
     if (!File::exists($this->argument('file'))) {
         $this->comment('No coverage file found, skipping.');
         return 0;
     }
     // Open serialised file
     $serialised = File::get($this->argument('file'));
     if (!Str::startsWith($serialised, '<?php')) {
         $coverage = unserialize($serialised);
         // Require PHP object in file
     } else {
         $coverage = (require $this->argument('file'));
     }
     // Check coverage percentage
     $total = $coverage->getReport()->getNumExecutableLines();
     $executed = $coverage->getReport()->getNumExecutedLines();
     $percentage = nf($executed / $total * 100, 2);
     // Compare percentage to threshold
     $threshold = $this->argument('threshold');
     if ($percentage >= $threshold) {
         $this->info("Code Coverage of {$percentage}% is higher than the minimum threshold required {$threshold}%!");
         return;
     }
     // Throw error
     $this->error("Code Coverage of {$percentage}% is below than the minimum threshold required {$threshold}%!");
     return 1;
 }
开发者ID:valorin,项目名称:vest,代码行数:34,代码来源:Coverage.php

示例2: stats_render

function stats_render()
{
    global $DBc;
    $html = "";
    $res = $DBc->sqlQuery("SELECT SUM(sp_money) as all_money, AVG(sp_money) as avg_money, COUNT(*) as playercount FROM app_achievements.stat_players as s, webig.players as p, ring_live.characters as c, nel.user as n WHERE s.sp_char = p.id AND p.cid = c.char_id AND c.user_id = n.uid AND n.privilege=''");
    $html .= "<b>Total characters</b>: " . nf($res[0]['playercount']) . "<p>";
    #$res = $DBc->sqlQuery("SELECT SUM(sp_money) as anz FROM stat_players");
    $html .= "<b>Total money</b>: " . nf($res[0]['all_money']) . "<p>";
    #$res = $DBc->sqlQuery("SELECT AVG(sp_money) as anz FROM stat_players");
    $html .= "<b>Average money</b>: " . nf($res[0]['avg_money']) . "<p>";
    $res = $DBc->sqlQuery("SELECT sp_money FROM app_achievements.stat_players as s, webig.players as p, ring_live.characters as c, nel.user as n WHERE s.sp_char = p.id AND p.cid = c.char_id AND c.user_id = n.uid AND n.privilege='' ORDER by sp_money ASC LIMIT " . floor($res[0]['playercount'] / 2) . ",1");
    $html .= "<b>Mean money</b>: " . nf($res[0]['sp_money']) . "<p>";
    return $html;
}
开发者ID:cls1991,项目名称:ryzomcore,代码行数:14,代码来源:adm_render_stats.php

示例3: admin_custom_room_column

/**
 * admin_custom_room_column()
 * 
 * Display custom column data
 * 
 * @param none
 * @return none
 */
function admin_custom_room_column($column, $post_id)
{
    switch ($column) {
        case 'room_status':
            $status = get_field('room_status', $post_id);
            echo sprintf('<span class="badge %s">%s</span>', sanitize_title_with_dashes($status), $status);
            break;
        case 'room_type':
            echo get_room_type($post_id)->post_title;
            break;
        case 'room_price':
            echo nf(get_field('price', $post_id));
            break;
    }
}
开发者ID:sergiocasquejo,项目名称:bigdream,代码行数:23,代码来源:admin.php

示例4: nf

                                                                                                    <td align="right" style="font-size: 14px;">$<?php 
            echo nf($a_order['shipping_price']);
            ?>
</td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td align="right" style="font-weight: bold; font-size: 14px;">GST (Included)</td>
                                                                                                    <td align="right" style="font-size: 14px;">$<?php 
            echo nf($total->gst_inclusive);
            ?>
</td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td align="right" style="font-weight: bold; font-size: 14px;">Total</td>
                                                                                                    <td align="right" style="font-size: 14px;">$<?php 
            echo nf($total->total_price_nf - $a_order['discount_amount']);
            ?>
</td>
                                                                                                </tr>
                                                                                            </tbody>
                                                                                        </table>
                                                                                    
                                                                                    <?php 
        }
        ?>

                                                                                </p>
                                                                            
                                                                            <?php 
    }
    ?>
开发者ID:EdgeCommerce,项目名称:edgecommerce,代码行数:31,代码来源:order.bak.php

示例5: ach_render_progressbar

function ach_render_progressbar($prog, $val, $width)
{
    $val = max(1, $val);
    $left = floor($width * (100 * ($prog / $val)) / 100);
    $html = "\r\n\t\t<table width='" . $width . "px' cellspacing='0' cellpadding='0' style='border:1px solid #FFFFFF;color:#000000;'>\r\n\t\t\t<tr>\r\n\t\t\t\t<td bgcolor='#66CC00' width='" . $left . "px' align='right'>";
    if ($prog / $val > 0.85) {
        $html .= "&nbsp;" . nf($prog) . " / " . nf($val) . "&nbsp;";
    }
    $html .= "</td>\r\n\t\t\t\t<td align='left' style='color:#FFFFFF;'>";
    if ($prog / $val <= 0.85) {
        $html .= "&nbsp;" . nf($prog) . " / " . nf($val) . "&nbsp;";
    }
    $html .= "</td>\r\n\t\t\t</tr>\r\n\t\t</table>";
    return $html;
}
开发者ID:ryzom,项目名称:ryzomcore,代码行数:15,代码来源:adm_render_csr.php

示例6: nf

                    <div class="col-xs-12 text-center">
                        <div class="huge"><?php 
echo nf((double) get_year_sales());
?>
</div>
                        <div>This Year</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-6">
            <div class="panel panel-violet">
                <div class="panel-heading">
                    <div class="col-xs-12 text-center">
                        <div class="huge"><?php 
echo nf((double) get_last_year_sales());
?>
</div>
                        <div>Last Year</div>
                    </div>
                </div>
            </div>
        </div>
    </div>

	<div class="row">
        <div class="graph-wrapper col-md-12">
            <div id="legend"></div>
    		<canvas id="canvas"></canvas>
        </div>
	</div>
开发者ID:sergiocasquejo,项目名称:bigdream,代码行数:31,代码来源:dashboard.html.php

示例7: the_field

</span></li>
							<li><span>Bed</span><span><?php 
the_field('bed', $data['room_type_ID']);
?>
</span></li>
							<li><span>View</span><span><?php 
the_field('view', $data['room_type_ID']);
?>
</span></li>
							<li>
								<span>Total Room <?php 
echo $data['no_of_room'];
?>
</span>
								<span><?php 
echo nf($data['amount']);
?>
</span>
							</li>
						</ul>
					</div>
					<div class="reservation-room-seleted_total">
						<label>TOTAL</label>
						<span class="reservation-total">
							<?php 
echo format_price($data['amount']);
?>
						</span>
					</div>
					<div class="guest-paid">
						<label>GUEST PAID</label>
开发者ID:sergiocasquejo,项目名称:bigdream,代码行数:31,代码来源:booking-details.html.php

示例8: ach_render_progressbar

function ach_render_progressbar($prog, $val, $width)
{
    $hero = false;
    if ($val == false) {
        $hero = true;
        $val = $prog;
    }
    $val = max(1, $val);
    $left = floor($width * (100 * ($prog / $val)) / 100);
    $left = max(1, $left);
    $html = "<table width='" . ($width + 12) . "px'>\r\n\t\t\t<tr>\r\n\t\t\t\t<td width='10px'></td>\r\n\t\t\t\t<td><table cellpadding='1px' width='" . ($width + 2) . "px'><tr><td bgcolor='#FFFFFF'>\r\n\t\t<table width='" . $width . "px' cellspacing='0' cellpadding='0'>\r\n\t\t\t<tr>\r\n\t\t\t\t<td bgcolor='#66CC00' width='" . $left . "px'><font color='#000000'>";
    if ($hero == false) {
        if ($prog / $val > 0.5) {
            $html .= "&nbsp;" . nf($prog) . " / " . nf($val) . "&nbsp;";
        }
        $html .= "</font></td>\r\n\t\t\t\t\t<td align='left' bgcolor='#00000066'><font color='#FFFFFF'>";
        if ($prog / $val <= 0.5) {
            $html .= "&nbsp;" . nf($prog) . " / " . nf($val) . "&nbsp;";
        }
    } else {
        $html .= "&nbsp;" . nf($prog) . "&nbsp;";
    }
    $html .= "</font></td>\r\n\t\t\t</tr>\r\n\t\t</table></td></tr></table></td>\r\n\t\t\t</tr>\r\n\t\t</table>";
    return $html;
}
开发者ID:ryzom,项目名称:ryzomcore,代码行数:25,代码来源:ach_render_ig.php

示例9: nf

?>
">
											</div>
										</div>
									</div>
								</div>
								<?php 
$totalBanco = $datos["MONBANCO1"] + $datos["MONBANCO2"] + $datos["MONBANCO3"];
?>
								<div class="row">
									<div class="col-md-12">
										<div class="form-group">
											<label class="control-label col-md-10">Total Depositos:</label>
											<div class="col-md-2">
												<p class="form-control-static"><?php 
echo nf($totalBanco);
?>
</p>
											</div>
										</div>
									</div>
								</div>
						</form>





						
					<!-- END EXAMPLE TABLE PORTLET-->
				</div>
开发者ID:flytechsistemas,项目名称:isum,代码行数:31,代码来源:index.php

示例10: handle_hidden_prices

function handle_hidden_prices(&$input)
{
    global $language;
    if (empty($input['tank_inspection'])) {
        unset($input['hidden_tank_inspection_price']);
    }
    if (empty($input['antifreeze'])) {
        unset($input['hidden_antifreeze_price']);
    }
    # voor het moment verberg altijd de tank_inspection_price in de mail
    //unset( $input['hidden_tank_inspection_price'] );
    $fields = array('hidden_mazout_liter_price', 'hidden_mazout_price', 'hidden_antifreeze_price', 'hidden_total_price');
    # replace all ',' to '.'
    foreach ($fields as $field) {
        if (empty($input[$field])) {
            continue;
        }
        # the javascript sometimes passes these values => unset the value
        if (strpos($input[$field], 'undefined') !== false || strpos($input[$field], 'false') !== false) {
            error_log('undefined / false value on field ' . $field . ' value = ' . $input[$field]);
            unset($input[$field]);
            continue;
        }
        $input[$field] = str_replace(',', '.', $input[$field]);
        $input[$field] = str_replace('€', '', $input[$field]);
        if (!is_numeric($input[$field])) {
            unset($input[$field]);
            continue;
        }
        $input[$field] = (double) $input[$field];
        if ($field == 'hidden_mazout_liter_price') {
            $btw_incl = $input[$field];
            $btw_excl = $input[$field] / 1.21;
            $btw_incl_indication = $language->language == 'nl' ? 'incl. BTW' : 'TVAC';
            $btw_excl_indication = $language->language == 'nl' ? 'excl. BTW' : 'hors TVA';
            $input[$field] = '€ ' . nf($btw_incl, 4) . '/l ' . $btw_incl_indication . ' (' . '€ ' . nf($btw_excl, 4) . '/l ' . $btw_excl_indication . ')';
        } else {
            if ($field == 'hidden_mazout_price') {
                $btw_incl_indication = $language->language == 'nl' ? 'incl. BTW' : 'TVAC';
                # indien antivries -> toon totaalbedrag mazout+antivries
                if (!empty($input['antifreeze'])) {
                    $input['hidden_total_price'] = str_replace('€', '€ ', $input['hidden_total_price']);
                    $input[$field] = $input['hidden_total_price'] . ' ' . $btw_incl_indication;
                } else {
                    $input[$field] = str_replace('.', ',', $input[$field]);
                    $input[$field] = '€ ' . number_format($input[$field], 2, ',', '') . ' ' . $btw_incl_indication;
                }
            } else {
                $input[$field] = '€ ' . nf($input[$field], 2);
            }
        }
    }
}
开发者ID:bartcornelis,项目名称:comfortenergy,代码行数:53,代码来源:customer_registration_mail.php

示例11: nf

     $pdf->SetFillColor($tab_modele_pdf["couleur_moy_general1"][$classe_id], $tab_modele_pdf["couleur_moy_general2"][$classe_id], $tab_modele_pdf["couleur_moy_general3"][$classe_id]);
     //if($total_coef_en_calcul != 0 and $affiche_moyenne_maxi_general[$classe_id] === '1' ){
     if ($total_coef_en_calcul != 0 and $tab_modele_pdf["affiche_moyenne_maxi_general"][$classe_id] === '1') {
         $moyenne_max = $total_moyenne_max_en_calcul / $total_coef_en_calcul;
     } else {
         $moyenne_max = '-';
     }
     if ($moyenne_max != '-') {
         //=========================
         // MODIF: boireaus 20080102
         // On remplace la moyenne mal calculée au sein de la page par la moyenne calculée dans /lib/calcul_moy_gen.inc.php
         //$moyenne_max=$tab_moy_max_classe[$classe_id][$id_periode];
         $moyenne_max = $tab_moy_max_classe[$classe_id][$id_periode];
         //$pdf->Cell($largeur_d_une_moyenne[$classe_id], $hauteur_entete_moyenne_general[$classe_id], present_nombre($moyenne_max, $arrondie_choix[$classe_id], $nb_chiffre_virgule[$classe_id], $chiffre_avec_zero[$classe_id]),1,0,'C', $couleur_moy_general[$classe_id]);
         //$pdf->Cell($largeur_d_une_moyenne[$classe_id], $hauteur_entete_moyenne_general[$classe_id], $moyenne_max,1,0,'C', $couleur_moy_general[$classe_id]);
         $pdf->Cell($tab_modele_pdf["largeur_d_une_moyenne"][$classe_id], $tab_modele_pdf["hauteur_entete_moyenne_general"][$classe_id], nf($moyenne_max), 1, 0, 'C', $tab_modele_pdf["couleur_moy_general"][$classe_id]);
         //=========================
     } else {
         //$pdf->Cell($largeur_d_une_moyenne[$classe_id], $hauteur_entete_moyenne_general[$classe_id], '-',1,0,'C', $couleur_moy_general[$classe_id]);
         $pdf->Cell($tab_modele_pdf["largeur_d_une_moyenne"][$classe_id], $tab_modele_pdf["hauteur_entete_moyenne_general"][$classe_id], '-', 1, 0, 'C', $tab_modele_pdf["couleur_moy_general"][$classe_id]);
     }
     //$largeur_utilise = $largeur_utilise + $largeur_d_une_moyenne[$classe_id];
     $largeur_utilise = $largeur_utilise + $tab_modele_pdf["largeur_d_une_moyenne"][$classe_id];
 }
 // rang de l'élève
 //if($active_rang[$classe_id]==='1' and $ordre_moyenne[$cpt_ordre] === 'rang') {
 if ($tab_modele_pdf["active_rang"][$classe_id] === '1' and $ordre_moyenne[$cpt_ordre] === 'rang') {
     $pdf->SetXY($X_note_moy_app + $largeur_utilise, $Y_note_moy_app);
     $pdf->SetFont('DejaVu', '', 8);
     //$pdf->SetFillColor($couleur_moy_general1[$classe_id], $couleur_moy_general2[$classe_id], $couleur_moy_general3[$classe_id]);
     $pdf->SetFillColor($tab_modele_pdf["couleur_moy_general1"][$classe_id], $tab_modele_pdf["couleur_moy_general2"][$classe_id], $tab_modele_pdf["couleur_moy_general3"][$classe_id]);
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:bulletin_pdf_avec_modele_classe.php

示例12: tt

                            <p><?php 
echo tt('Frost free');
?>
</p>
                        </div>

                        <div class="product_card_content">
                            <p><?php 
echo tt('Price from 2000L');
?>
 (<?php 
echo $items['price']['last_modified'];
?>
)</p>
                            <p class="bold card_item">&euro; <?php 
echo nf($items['price']['price_standaard'], 4);
?>
/l</p>
                        </div>
     
                        <div class="product_card_content card_button">
                            <a class="button red" href="<?php 
echo $calculator_link;
?>
?product=mazout-standard"><?php 
echo tt('Calculate the price');
?>
</a>
                        </div>
                    </div>  
                </div>
开发者ID:bartcornelis,项目名称:comfortenergy,代码行数:31,代码来源:a20_31_table_mobile.tpl.php

示例13: zone_browser

function zone_browser($like = NULL, $highlight = NULL)
{
    global $zone_group_size, $soa_table_name, $rr_table_name, $use_pgsql;
    echo "<DIV align=center>\n";
    if ($zone_group_size == 0) {
        $res = sql_query(soa_select() . " ORDER BY origin") or ErrSQL("Error loading SOA record(s).");
    } else {
        /* Get current offset and total number of zones */
        $page = getpostvar('page');
        $total = sql_count("SELECT COUNT(*) FROM {$soa_table_name} {$like}", "number of SOA records");
        $offset = offset_select($page, $total, $zone_group_size, "action=browse");
        $query = soa_select() . " {$like} ORDER BY origin ";
        if ($use_pgsql) {
            $query .= "LIMIT {$zone_group_size} OFFSET {$offset}";
        } else {
            $query .= "LIMIT {$offset},{$zone_group_size}";
        }
        $res = sql_query($query) or ErrSQL("Error loading SOA record(s).");
    }
    ?>
<TABLE class=browserBox cellspacing=0>

<?php 
    while ($soa = sql_fetch_array($res)) {
        $record_count = sql_count("SELECT COUNT(*) FROM {$rr_table_name} WHERE zone={$soa['id']}", "number of resource records in zone {$soa['id']}");
        $output_origin = $soa['origin'];
        if ($highlight) {
            $output_origin = str_replace($highlight, "<span class=highlight>{$highlight}</span>", $output_origin);
        }
        ?>
	<TR bgcolor="<?php 
        echo bgcolor();
        ?>
">
		<TD class=browserCellLeft><A href="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
?zone=<?php 
        echo $soa['id'];
        ?>
"
			title="Edit zone <?php 
        echo $soa['id'];
        ?>
"><?php 
        echo $output_origin;
        ?>
</A>
		<TD class=browserCellRight><?php 
        echo nf($record_count);
        ?>
 record(s)
<?php 
    }
    echo "</TABLE>\n";
    echo "</DIV>\n";
}
开发者ID:evmuc,项目名称:mydns-ng,代码行数:57,代码来源:admin.php

示例14: nf

echo nf('2000', 0);
?>
L</th>
                </tr>
            <?  foreach ( $prices as $record ){ ?>
                    <tr>
                        <td class="bold"><?php 
echo htmlentities($record['name'], ENT_COMPAT, 'UTF-8');
?>
</td>
                        <td>&euro; <?php 
echo htmlentities(nf($record['official_1000l_price'], 4), ENT_COMPAT, 'UTF-8');
?>
</td>
                        <td>&euro; <?php 
echo htmlentities(nf($record['official_2000l_price'], 4), ENT_COMPAT, 'UTF-8');
?>
</td>
                    </tr>
            <?  } ?>
            </table>

            <div class="table_bottom">
                <p><?php 
echo tt('Prices of');
?>
 <?php 
echo $fd($prices[0]['modified']);
?>
.</p>
                <a class="button red" href="/<?php 
开发者ID:bartcornelis,项目名称:comfortenergy,代码行数:31,代码来源:a76_50_content.tpl.php

示例15: Amount

                                                                    <!--<td class="order_price">&nbsp;</td>-->
                                                                </tr>
                                                                <tr class="order_total">
                                                                    <td class="order_invisible" colspan="5" style="background-color:white; border:0;">&nbsp;</td>
                                                                    <td class="order_text"><strong>GST Amount (Included)</strong></td>
                                                                    <td class="center order_price" style="text-align:right">$<span class="gst"><?php 
    echo nf($gst);
    ?>
</span></td>
                                                                    <!--<td class="order_price">&nbsp;</td>-->
                                                                </tr>
                                                                <tr class="order_total">
                                                                    <td class="order_invisible" colspan="5" style="background-color:white; border:0;">&nbsp;</td>
                                                                    <td class="order_dark_text"><strong>Current Grand Total</strong></td>
                                                                    <td class="center order_dark_price" style="text-align:right"><strong class="grand_total_box">$<span class="grand_total"><?php 
    echo nf($total - $order->discount_amount + $order->shipping_price + $gst);
    ?>
</span></strong></td>
                                                                    <!--<td class="order_dark_price">&nbsp;</td>-->
                                                                </tr>

                                                        <?php 
} else {
    ?>
                                                            <tr><td colspan="9">There are no items.</td></tr>
                                                        <?php 
}
?>
                                                    </tbody>
                                                </table>
开发者ID:EdgeCommerce,项目名称:edgecommerce,代码行数:30,代码来源:update.php


注:本文中的nf函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。