简体   繁体   中英

currency number format styles in webpage

I want to display my fare details as below.

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

html code:

<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> 

All these values will come dynamically. so can any one let me how to style these values. Thanks in advance.

We can do with accounting.js library.

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

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

refer: http://openexchangerates.github.io/accounting.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM