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
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!
First Ensure that your HTML document is encoded in UTF-8 by including this line in the head section to avoid any encoding issues:
in you HTML use Entity Code:
This will render as:
Price: ₦ 1000