在网站上显示印度货币符号

2010年7月15日,联邦内阁批准了印度卢比的象征。我如何在网站上显示它?

Indian currency symbol

187979 次浏览

This can be sought of a temporary solution. Unicode has accepted U+20B9 as Indian rupee symbol soon all systems will update themselves

WebRupee is a web API for the Indian currency symbol. It provides a simple, cross browser method for using the Rrupee symbol on your webpage, blog or anywhere on the web.

Here is a method for printing the Indian currency symbol:

<html>
<head>
<link rel="stylesheet" type="text/css" href="http://cdn.webrupee.com/font">
<script src=http://cdn.webrupee.com/js type=”text/javascript”></script>
</head>
<body>
Rupee Symbol: <span class="WebRupee">Rs.</span> 200

This means if somebody copies text from your site and pastes it somewhere else, he will see Rs and not some other or blank character.

You can now also use the new Rupee unicode symbol — U+20B9 INDIAN RUPEE SIGN. It can be used in this manner:

<span class="WebRupee">&#x20B9;</span> 500

Just include the following script and it will update all the "Rs" / "Rs." for you:

<script src="http://cdn.webrupee.com/js" type="text/javascript"></script>

It will take more than an year (or two) for the universal acceptance.

  1. Unicode consortium approves the char-code.
  2. Fonts are updated to include this symbol
  3. Browsers/OS are updated to include new fonts and then only it is visible on every browser on earth.

Creating custom fonts by using arbitrary code-base and (forcefully) embedding them in every web-pages is discouraged for Website. (for desktop applications it may be acceptable). Although your solution may be acceptable; I would not advice just for the sake of one symbol! Loading a font file makes web-pages slower.

By the time it is advised to use icon-sets for rupee symbol. Prepare a set of icons with sizes 12x8, 16x12, 32x32 that you can incorporate in-line using <img> tag.

E.g 5000/- (i just resized the image; it should have been re-sampled for given size for better results)

<img src="http://i.stack.imgur.com/nGbfO.png" width="8" height="10">

Note: This is what Wikipedia does. it uses png/svg file. Check the infobox here.

use this new unicode char: &#x20b9;

Use this CSS:

@font-face {
font-family: 'rupee';
src: url('rupee_foradian-1-webfont.eot');
src: local('☺'), url(data:font/truetype;charset=utf-8;base64,AAEAAAANAIAAAwBQRkZUTVen5G0AAADcAAAAHEdERUYAQAAEAAAA+AAAACBPUy8yRQixzQAAARgAAABgY21hcGmyCE0AAAF4AAABamdhc3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AbAAgAEcAZQBuAGUAcgBhAHQAbwByAC4AAAIAAAAAAAD/JwCWAAAAAAAAAAAAAAAAAAAAAAAAAAAAEwAAAAEAAgADADUBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0BDgEPB3VuaTAwQTAHdW5pMjAwMAd1bmkyMDAxB3VuaTIwMDIHdW5pMjAwMwd1bmkyMDA0B3VuaTIwMDUHdW5pMjAwNgd1bmkyMDA3B3VuaTIwMDgHdW5pMjAwOQd1bmkyMDBBB3VuaTIwMkYHdW5pMjA1Rg==)
format('truetype');
font-weight: normal;
font-style: normal;
}

Declare it wherever required like this:

<span style="font-family:rupee;font-size:20px">R</span>

Just type <del>&#2352;</del> in your web page.

The HTML entity for the Indian rupee sign is &#8377; (₹). Use it like you would &copy; for the copyright sign. For more, read Wikipedia's article on the rupee sign.

Image approach is not bad either. It hardly takes 400Bytes.
Download from here http://i.stack.imgur.com/vJZ9m.png

<span class="rupee"></span>

Well i found it better than webrupee.

For colors edit the image as below

    .rupee{
background-position:left;
width: 10px;
height: 14px;
background-image: url('rupee.png');
display:block;
background-repeat: no-repeat;
}

WebRupee API Available Here:

<script src="http://cdn.jagansindia.in/webrupee" type="text/javascript"></script>

You can also read full details here

JQUERY INR v1.2

A simple jQuery plug-in for convert Rs. to standard Indian rupee symbol through out the web page. Simple to use and simple instillation

The Indian Rupee sign is the currency sign: ₹ for the Indian Rupee, the official currency of India. Designed by D. Udaya Kumar, it was presented to the public by the Government of India on 15 July 2010,[1] following its selection through an “open” competition among Indian residents. Before its adoption, the most commonly used symbols for the rupee were Rs, Re or, if the text was in an Indian language, an appropriate abbreviation in that language. The new sign relates solely to the Indian rupee; other countries that use a rupee, such as Sri Lanka, Pakistan and Nepal, still use the generic U+20A8 ₨ rupee sign character. The design resembles both the Devanagari letter "र" (ra) and the Latin capital letter "R", with a double horizontal line at the top.

Instillation:

  1. Download the “jQueryINR_v1.2.zip” and extract.
  2. copy images (“rupee.svg, rupee.gif”) to your images folder.
  3. cope scripts folder to your project path or else copy the .js files to your script folder.
  4. Download the “jQueryINR_v1.2.zip” and extract.
  5. copy images (“rupee.svg, rupee.gif”) to your images folder.
  6. cope scripts folder to your project path or else copy the .js files to your script folder.
  7. Include jQuery min and jQuery Ui to your page first

    NB: use jQuery stable version only

  8. include the “indianRupee_v1.2.js” and “indianRupee_ctrl.js” after the jQuery library eg:

  9. Use Span tag to wrap Rs through out the web it will replace with the symbol eg: Rs 1280000/-

Source:

Pay Him Rs 1280000/-

Pay Him Rs 528500/-

Pay Him Rs 1250/-

Pay Him Rs 1280000/-

Result:

   http://romy.theqtl.com/rupeePlugin/

Plug-in Options:

$("body").indianRupee({ targets:"span",// use as default we can also use [p, div, h1 , li etc...] vector:"on"//[on/off] of [true/false] NB: {vector not support in Internet Explore } });

If you are using font awesome icons, then you can use this:

To import font-awesome:

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

Usage:

Current Price: <i class="fa fa-inr"></i> 400.00

will show as:

Imgur

There are two html entity code : &#x20b9; &#8377;

Please try the following solution:

<span style='font-family:Arial;'>&#8377;</span>

This will be displayed as : ₹

You can do it with Intl.NumberFormat native API.

const number = 123456.78;


// India uses thousands/lakh/crore separators
console.log(new Intl.NumberFormat('en-IN', {
style: 'currency',
currency: 'INR'
}).format(number));

It's possible with simple HTML entity code.

.ex{
color:green;
font-size:20px;
}
Example 1 : <span class="ex">&#x20b9;1200/-</span><br>
Example 2 : <span class="ex">&#8377;3545/-</span><br>
Example 3 : <span class="ex">&#2352;134/-</span> *Is not the exact Rupee symbol

best way copy the ₹ symbol and paste it.

Just In Case. If you are binding amount to a ASP.Net label then you can display rupee sign like below

lblAmount.Text = "&#8377;"+ YourDataTable.Rows[rowindex]["AmountColumnName"];