2014-02-14 147 views
2

如何在百里香的算術運算?我已經測試過可能的方式。但無法獲得輸出。如果你知道,請讓我知道 這是我的代碼。百里香的算術運算

/*Dummy Content */ 
      <p class="quan-inc-dec"> 
            <input type="hidden" name="productId" th:value="*{product.id}" class="productId"/> 
            <input type="hidden" name="orderItemId" th:value="*{id}" class="orderItemId"/> 
            <input type="button" name="minus" class="minus" value="-" autocomplete="off" /> 
            <input type="text" name="quantity" value="1" class="result" autocomplete="off" th:value="*{quantity}" /> 
            <input type="button" name="plus" class="plus" autocomplete="off" value="+" /> 
           </p> 
/*Dummy Content End*/ 
    <span th:text="${${obj.baseRetailPrice}*${obj.aa}}"> -- I need the Result Here --</div> 

回答

10

像這樣:

<div th:with="result=${obj.baseRetailPrice * obj.aa}"> 
    <span th:text="${result}"></span> 
</div> 
+0

你可以做到這一點沒有股利爲好。 – user3344977