2017-10-13 14 views
-2

我想顯示我的票價詳情如下。網頁中的貨幣數字格式樣式

Faredetails 
------------------- 
Price   : 1000 
VAT    : 20(+) 
GST    : 15(+) 
Discount   : 100(-) 
       --------------- 
Total   : 1065 

的html代碼:

<div class="div-active faredet"> 
       <h3 style="text-align:center;border-bottom: 1px solid #ccc;">Fare Details</h3> 
       <table> 
        <tr> 
         <td>Fare&nbsp;&nbsp;</td> 
         <td>&#x20B9;1,000.00</td> 
        </tr> 
        <tr> 
         <td>Discuount&nbsp;&nbsp;</td> 
         <td>&#8377;10.00<span style="color:red;">&nbsp;(-)</span></td> 
        </tr> 
        <tr style="border-bottom: 1px solid #ccc;"></tr> 
        <tr> 
         <td>Net Payable&nbsp;&nbsp;</td> 
         <td>&#8377;900.00</td> 
        </tr> 
       </table> 

      </div> 

所有這些值將動態來。所以任何人都可以讓我如何設計這些值。提前致謝。

+0

給我們一些代碼,我們不能只寫你的整個腳本 –

+0

@TimGerhard:更新的代碼 – Sucharitha

回答

0

我們可以使用accounting.js庫。

<script src="path/to/accounting.js"></script> 

<script type="text/javascript"> 
    // Library ready to use: 
    accounting.formatMoney(5318008); 
</script> 

參考:http://openexchangerates.github.io/accounting.js

+0

我檢查了這一點,但它不支持INR currecy格式。 – Sucharitha