今天需要用到在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 丁克設計 閱讀(1594) 評論(0)  編輯  收藏 所屬分類: PHP技術文檔

          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          導航

          留言簿(6)

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          主站蜘蛛池模板: 萝北县| 靖安县| 门源| 桐梓县| 平顺县| 康保县| 彰武县| 阿巴嘎旗| 泉州市| 景德镇市| 东海县| 嫩江县| 班玛县| 宾川县| 淄博市| 东城区| 沾化县| 大安市| 新营市| 肥东县| 呼图壁县| 濮阳市| 青海省| 湘潭县| 平塘县| 收藏| 巢湖市| 临颍县| 虞城县| 许昌县| 石棉县| 夹江县| 青川县| 醴陵市| 合江县| 黎川县| 镶黄旗| 融水| 阿瓦提县| 子长县| 武义县|