skip to Main Content

I was writing an html codes for online shopping and i needed to include a currency symbol other than the default $ option because it’s going to be in another form of currency and not dollar. currency like the Naira which has N with double strike through. I can do that in the microsoft word because it has the strike through and double strike through features but i am stuck in this vs code editor

I tried adding a naira symbol but the only available feature is a dollar and euro currency sign on my keyboard

2

Answers


  1. In HTML, it is common to use unicode for currencies or other symbols. https://www.w3schools.com/charsets/ref_utf_symbols.asp

    In VS code you can do this as well to print to the console; take a look at this: How to correctly display unicode characters in VS Code's Integrated Terminal?

    If you want to use unicode in the file itself (in your code), a Google search will give you the answer. There are a lot of extentions for VS code to support this (and make it easy).

    NOTE: Using unicodecharacters in sourcecode is not good practice!

    Login or Signup to reply.
  2. First Ensure that your HTML document is encoded in UTF-8 by including this line in the head section to avoid any encoding issues:

    <meta charset="UTF-8">
    

    in you HTML use Entity Code:

    <p>Price: &#8358; 1000</p>
    

    This will render as: Price: ₦ 1000

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search