今天需要用到在smarty模版中將兩個變量相加

          1. {* $height=4, $width=5 *}
          2. {math equation="x + y" x=$height y=$width}
          3. OUTPUT:
          4. 9

          5. {* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
          6. {math equation="height * width / division"
          7.       height=$row_height
          8.       width=$row_width
          9.       division=#col_div#}
          10. OUTPUT:
          11. 100

          12. {* you can use parenthesis *}
          13. {math equation="(( x + y ) / z )" x=2 y=10 z=2}
          14. OUTPUT:
          15. 6

          16. {* you can supply a format parameter in sprintf format *}
          17. {math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
          18. OUTPUT:
          19. 9.44

          posted on 2008-12-11 00:11 丁克設(shè)計 閱讀(1601) 評論(0)  編輯  收藏 所屬分類: PHP技術(shù)文檔

          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導(dǎo)航

          留言簿(6)

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          主站蜘蛛池模板: 哈尔滨市| 伊金霍洛旗| 辽阳县| 洛南县| 安平县| 米脂县| 原阳县| 福泉市| 司法| 将乐县| 固安县| 永丰县| 兰州市| 汉源县| 伊吾县| 都安| 元朗区| 化德县| 伊春市| 万荣县| 黔南| 嘉义市| 岑溪市| 夹江县| 寻乌县| 西宁市| 湖北省| 东阳市| 涿鹿县| 万宁市| 张家界市| 漳州市| 安塞县| 驻马店市| 宁夏| 盖州市| 金阳县| 吉隆县| 锡林郭勒盟| 驻马店市| 墨竹工卡县|