Rupee symbol in iOS
Asked Answered
D

7

13

How do I add a rupee symbol in a UILabel on the iPhone?

Domingodominguez answered 27/3, 2011 at 8:52 Comment(3)
It's Unicode character U+20A8 if that helps.Dialecticism
₨ for those like me interested.Mazur
I think you are talking about new symbol of Rs right?Latticework
I
19

Rupee symbol is available as part of the platform itself. Go to Edit > Special Characters > Currency Symbols.

When I used it first, I was under the impression that this is part of the menu options of Xcode, but right now while I am typing here on this page opened in Firefox and I go to Edit menu, I see the same Special characters option in the menu so probably it is part of OSX itself. Just drag and drop it anywhere on the storyboard where you want this symbol to appear. I'm just dragging and dropping the same here, let's see whether it appears here or not!

This integration of special characters in osx is pretty handy and also has many variations for that special character (rupee symbol in this case)

Interrogative answered 29/11, 2012 at 10:59 Comment(0)
L
32

Here is How I've done this by using Unicode Character It's working and tested by me.

NSString *rupee=@"\u20B9"; NSLog(@"print rupee symbol %@",rupee); Please refer this link UniCode Character

For Swift Language you should try!

let rupee = "\u{20B9}"
println(rupee)

// for Swift >2.0

let rupee = "\u{20B9}"
print(rupee)

more about UniChar you should check this Official Apple Doc Cheers :)

Lewie answered 6/10, 2014 at 4:25 Comment(0)
I
19

Rupee symbol is available as part of the platform itself. Go to Edit > Special Characters > Currency Symbols.

When I used it first, I was under the impression that this is part of the menu options of Xcode, but right now while I am typing here on this page opened in Firefox and I go to Edit menu, I see the same Special characters option in the menu so probably it is part of OSX itself. Just drag and drop it anywhere on the storyboard where you want this symbol to appear. I'm just dragging and dropping the same here, let's see whether it appears here or not!

This integration of special characters in osx is pretty handy and also has many variations for that special character (rupee symbol in this case)

Interrogative answered 29/11, 2012 at 10:59 Comment(0)
V
9

Yups, Parth is right just copy and paste the rupee symbol (₹) to NSString and you are done.

Valency answered 5/6, 2013 at 18:25 Comment(0)
D
4

In Swift 4

let RSlabel = UILabel()

let cost = 1000

override func viewDidLoad() {

super.viewDidLoad()

RSlabel.text = "\u{20B9}"+"\(cost)"

print(RSlabel,"RSlabel")

}

Deputize answered 5/12, 2018 at 8:36 Comment(0)
L
2

May be you will have to find some language which has a similar symbol.

Or you can just copy the Rupee symbol from somewhere (like from some soft-copy document which contains that) and paste it directly from there into your UILabel text.

As for now I don't know any other way apart from this as present keyboards dont have a Rupee symbol as yet. May be in future it would be having that :)

Hope this helps you

Latticework answered 27/3, 2011 at 9:42 Comment(0)
W
2

Go to

Edit -> Emoji & Symbols

In Xcode 7, the symbols location has been changed a bit from what has been suggested by Atul.

Wardmote answered 1/6, 2016 at 8:12 Comment(0)
L
0

Go through the below SO post,

Localize Currency for iPhone

Edited:

you could also go with the approach of having rupee symbol as an UIImageView and show it before OR after a UILabel view.

Please see the reference code :

Have below in .h file...

UIView* iContainerView;
UIImageView* iRupeeSymbol;
UILabel* iAmountLabel;

And your .m file would be like below.

iRupeeSymbol= [[UIImageView alloc] initWithImage:myRupeeImage];
iAmountLabel.text = @"55555";

[iContainetView  addSubview:iRupeeSymbol];
[iContainetView  addSubview:iAmountLabel];

[self.view addSubview:iContainetView];

And set the appropriate frame value for all three views,

Lynden answered 27/3, 2011 at 8:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.