Empty rectanglar box is displayed instead of the rupee symbol in HTML

前端 未结 2 2006
故里飘歌
故里飘歌 2020-11-30 15:19

I am using this code to display rupee symbol.

₹ ; // semicolon is just after 9.

for example

           


        
相关标签:
2条回答
  • 2020-11-30 15:55

    You can do it with Intl.NumberFormat.

    var number = 400000;
    
    console.log(new Intl.NumberFormat('en-IN', {
      style: 'currency',
      currency: 'INR'
    }).format(number));

    Or using Icons8 for Indian Rupee (INR).

    CDN

    <!-- Image size: 24px -->
    <img src="https://img.icons8.com/material/24/000000/rupee.png">

    Base64

    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADbSURBVEhL3dUxCwFxGMfxK0UGg4EsNpPZaDZaDcpoMXo13oDZC2CSGGSyMpgsJlJK+P6uri6d+rv/Y/Gtz3BX93/quZPgb3um5FzSwy5SV0IHe+igFTIwT4N20JC+bvyiHjRgFl6lLNrpt5xLetiFSdGKFuGVcfGXPNANq8qIf6YbZJG6aKdJdHgFXr0fesESWksO3ulHdIcOH8NrHZ9q4woNmaIA85o4QUPW8N59UnUcoCH6RGswr4otNOSIBswrYg4NOaMF8/KYQENu6MI8/dGMoCEPDPG3BcELTYVtU4m89QEAAAAASUVORK5CYII=">

    0 讨论(0)
  • 2020-11-30 16:14

    Some of the browsers/OS don't support rupee symbol &#x20B9; yet.

    Fixes:

    1. You may use a CSS font which supports it to use the symbol.

      <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
      
      <i class="fa fa-inr"></i>

    2. Use similar symbol: <del>&#2352;</del> =>

    3. Try &#8377; => ₹

    4. Use an image(bad solution but works): <img src="http://i.stack.imgur.com/nGbfO.png" width="8" height="10"> =>

    0 讨论(0)
提交回复
热议问题