Get Smarty

Donate

Donate Bitcoin Bitcoin
Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Buy cheap glasses from Cheapglasses123.com and save up to 80%.

Where to buy prescription glasses? EyewearCanada.com is your best choice!

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Find Wedding Dresses Online at Canada from Ca-dress.com

Discount Wedding Dresses at EvWedding.com

soccer kp is New 2016 Nike Mercurial Superfly V soccer cleats from soccerkpkp.com

Advertisement

string_format

変数の値を10進数として表示したり、文字列をフォーマットして表示します。 フォーマット文字列には sprintf() の構文を使用してください。

パラメータの位置 必須 デフォルト 概要
1 string Yes n/a フォーマット文字列(sprintf)

Example 5.18. string_format


<?php

$smarty->assign('number', 23.5787446);

?>

   

テンプレート


{$number}
{$number|string_format:"%.2f"}
{$number|string_format:"%d"}

   

出力


23.5787446
23.58
24

   

date_format も参照してください。

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 15 plus 2? (Are you human?)

Advertisement