iOS貨幣簡寫與貨幣符號轉(zhuǎn)換

開發(fā)中會用到貨幣的簡寫和貨幣符號轉(zhuǎn)換的情況,下面是一個人的一個總結(jié)角溃,輸入的是每個國家的貨幣三位英文縮寫拷获,輸出的是貨幣的符號表示

- (NSString *)moneyTagWithMoneyCode:(NSString *)moneyCode{
    
    NSString *moneyTag = moneyCode;
    
    // 亞洲
    if ([moneyCode isEqualToString:@"HKD"]) moneyTag = @"HK$";
    if ([moneyCode isEqualToString:@"MOP"]) moneyTag = @"PAT";
    if ([moneyCode isEqualToString:@"CNY"]) moneyTag = @"¥";
    if ([moneyCode isEqualToString:@"YND"]) moneyTag = @"D";
    if ([moneyCode isEqualToString:@"JPY"]) moneyTag = @"J¥";
    if ([moneyCode isEqualToString:@"LAK"]) moneyTag = @"K";
    if ([moneyCode isEqualToString:@"KHR"]) moneyTag = @"CR";
    if ([moneyCode isEqualToString:@"PHP"]) moneyTag = @"P";
    if ([moneyCode isEqualToString:@"MYR"]) moneyTag = @"M$";
    if ([moneyCode isEqualToString:@"SGD"]) moneyTag = @"S$";
    if ([moneyCode isEqualToString:@"THP"]) moneyTag = @"BT$";
    if ([moneyCode isEqualToString:@"BUK"]) moneyTag = @"K";
    if ([moneyCode isEqualToString:@"LKR"]) moneyTag = @"S.Re";
    if ([moneyCode isEqualToString:@"MVR"]) moneyTag = @"M.R.R";
    if ([moneyCode isEqualToString:@"IDR"]) moneyTag = @"Rps";
    if ([moneyCode isEqualToString:@"PRK"]) moneyTag = @"Pak.Re";
    if ([moneyCode isEqualToString:@"INR"]) moneyTag = @"Re";
    if ([moneyCode isEqualToString:@"NPR"]) moneyTag = @"N.Re";
    if ([moneyCode isEqualToString:@"AFA"]) moneyTag = @"Af";
    if ([moneyCode isEqualToString:@"IRR"]) moneyTag = @"RI";
    if ([moneyCode isEqualToString:@"IQD"]) moneyTag = @"ID";
    if ([moneyCode isEqualToString:@"SYP"]) moneyTag = @"£.S";
    if ([moneyCode isEqualToString:@"LBP"]) moneyTag = @"£L";
    if ([moneyCode isEqualToString:@"JOD"]) moneyTag = @"J.D";
    if ([moneyCode isEqualToString:@"SAR"]) moneyTag = @"S.A.RIs";
    if ([moneyCode isEqualToString:@"KWD"]) moneyTag = @"K.D";
    if ([moneyCode isEqualToString:@"BHD"]) moneyTag = @"BD";
    if ([moneyCode isEqualToString:@"QAR"]) moneyTag = @"QR";
    if ([moneyCode isEqualToString:@"OMR"]) moneyTag = @"RO";
    if ([moneyCode isEqualToString:@"YER"]) moneyTag = @"YRL";
    if ([moneyCode isEqualToString:@"YDD"]) moneyTag = @"YD";
    if ([moneyCode isEqualToString:@"TRL"]) moneyTag = @"£T";
    if ([moneyCode isEqualToString:@"CYP"]) moneyTag = @"£C";
    
    // 大洋洲
    if ([moneyCode isEqualToString:@"AUD"]) moneyTag = @"$A";
    if ([moneyCode isEqualToString:@"NZD"]) moneyTag = @"$NZ";
    if ([moneyCode isEqualToString:@"FJD"]) moneyTag = @"F.$";
    if ([moneyCode isEqualToString:@"SBD"]) moneyTag = @"SL.$";
    
    // 歐洲
    if ([moneyCode isEqualToString:@"EUR"]) moneyTag = @"EUR";
    if ([moneyCode isEqualToString:@"ISK"]) moneyTag = @"I.Kr";
    if ([moneyCode isEqualToString:@"DKK"]) moneyTag = @"D.Kr";
    if ([moneyCode isEqualToString:@"NOK"]) moneyTag = @"N.Kr";
    if ([moneyCode isEqualToString:@"SEK"]) moneyTag = @"S.Kr";
    if ([moneyCode isEqualToString:@"FIM"]) moneyTag = @"FMK";
    if ([moneyCode isEqualToString:@"SUR"]) moneyTag = @"Rbs";
    if ([moneyCode isEqualToString:@"PLZ"]) moneyTag = @"ZL";
    if ([moneyCode isEqualToString:@"CSK"]) moneyTag = @"Kcs";
    if ([moneyCode isEqualToString:@"HUF"]) moneyTag = @"FT";
    if ([moneyCode isEqualToString:@"DEM"]) moneyTag = @"DM";
    if ([moneyCode isEqualToString:@"ATS"]) moneyTag = @"ScH";
    if ([moneyCode isEqualToString:@"CHF"]) moneyTag = @"SF";
    if ([moneyCode isEqualToString:@"NLG"]) moneyTag = @"Gs";
    if ([moneyCode isEqualToString:@"BEF"]) moneyTag = @"Bi";
    if ([moneyCode isEqualToString:@"LUF"]) moneyTag = @"Lux.F";
    if ([moneyCode isEqualToString:@"GBP"]) moneyTag = @"£";
    if ([moneyCode isEqualToString:@"IEP"]) moneyTag = @"£.Ir";
    if ([moneyCode isEqualToString:@"FRF"]) moneyTag = @"F.F";
    if ([moneyCode isEqualToString:@"ESP"]) moneyTag = @"Pts";
    if ([moneyCode isEqualToString:@"PTE"]) moneyTag = @"ESC";
    if ([moneyCode isEqualToString:@"ITL"]) moneyTag = @"Lit";
    if ([moneyCode isEqualToString:@"MTP"]) moneyTag = @"£.M";
    if ([moneyCode isEqualToString:@"ROL"]) moneyTag = @"L";
    if ([moneyCode isEqualToString:@"BGL"]) moneyTag = @"Lev";
    if ([moneyCode isEqualToString:@"ALL"]) moneyTag = @"Af";
    if ([moneyCode isEqualToString:@"GRD"]) moneyTag = @"Dr";
    
    // 美洲
    if ([moneyCode isEqualToString:@"CAD"]) moneyTag = @"Can.$";
    if ([moneyCode isEqualToString:@"USD"]) moneyTag = @"U.S.$";
    if ([moneyCode isEqualToString:@"MXP"]) moneyTag = @"Mex.$";
    if ([moneyCode isEqualToString:@"GTQ"]) moneyTag = @"Q";
    if ([moneyCode isEqualToString:@"SVC"]) moneyTag = @"¢";
    if ([moneyCode isEqualToString:@"HNL"]) moneyTag = @"L";
    if ([moneyCode isEqualToString:@"NIC"]) moneyTag = @"CS";
    if ([moneyCode isEqualToString:@"CRC"]) moneyTag = @"¢";
    if ([moneyCode isEqualToString:@"PAB"]) moneyTag = @"B";
    if ([moneyCode isEqualToString:@"CUP"]) moneyTag = @"Cu.Pes";
    if ([moneyCode isEqualToString:@"BSD"]) moneyTag = @"B.$";
    if ([moneyCode isEqualToString:@"JMD"]) moneyTag = @"$.J";
    if ([moneyCode isEqualToString:@"HTG"]) moneyTag = @"G";
    if ([moneyCode isEqualToString:@"DOP"]) moneyTag = @"R.D.$";
    if ([moneyCode isEqualToString:@"TTD"]) moneyTag = @"T.T.$";
    if ([moneyCode isEqualToString:@"BBD"]) moneyTag = @"BDS.$";
    if ([moneyCode isEqualToString:@"COP"]) moneyTag = @"Col.$";
    if ([moneyCode isEqualToString:@"VEB"]) moneyTag = @"B";
    if ([moneyCode isEqualToString:@"GYD"]) moneyTag = @"G.$";
    if ([moneyCode isEqualToString:@"SRG"]) moneyTag = @"S.FI";
    if ([moneyCode isEqualToString:@"PES"]) moneyTag = @"S/";
    if ([moneyCode isEqualToString:@"ECS"]) moneyTag = @"S/";
    if ([moneyCode isEqualToString:@"BRC"]) moneyTag = @"Gr.$";
    if ([moneyCode isEqualToString:@"BOP"]) moneyTag = @"NBol.P";
    if ([moneyCode isEqualToString:@"CLP"]) moneyTag = @"P";
    if ([moneyCode isEqualToString:@"ARP"]) moneyTag = @"Arg.P";
    if ([moneyCode isEqualToString:@"PVG"]) moneyTag = @"Guars";
    if ([moneyCode isEqualToString:@"UYP"]) moneyTag = @"N.$";
    
    // 非洲
    if ([moneyCode isEqualToString:@"EGP"]) moneyTag = @"£E";
    if ([moneyCode isEqualToString:@"LYD"]) moneyTag = @"LD";
    if ([moneyCode isEqualToString:@"SDP"]) moneyTag = @"£S";
    if ([moneyCode isEqualToString:@"TND"]) moneyTag = @"TD";
    if ([moneyCode isEqualToString:@"DZD"]) moneyTag = @"AD";
    if ([moneyCode isEqualToString:@"MAD"]) moneyTag = @"DH";
    if ([moneyCode isEqualToString:@"MRO"]) moneyTag = @"UM";
    if ([moneyCode isEqualToString:@"XOF"]) moneyTag = @"C.F.A.F";
    if ([moneyCode isEqualToString:@"GMD"]) moneyTag = @"D.G";
    if ([moneyCode isEqualToString:@"GWP"]) moneyTag = @"PG";
    if ([moneyCode isEqualToString:@"GNS"]) moneyTag = @"GS";
    if ([moneyCode isEqualToString:@"SLL"]) moneyTag = @"Le";
    if ([moneyCode isEqualToString:@"LRD"]) moneyTag = @"Lib.$";
    if ([moneyCode isEqualToString:@"GHC"]) moneyTag = @"¢";
    if ([moneyCode isEqualToString:@"NGN"]) moneyTag = @"N";
    if ([moneyCode isEqualToString:@"XAF"]) moneyTag = @"CFAF";
    if ([moneyCode isEqualToString:@"GQE"]) moneyTag = @"EK";
    if ([moneyCode isEqualToString:@"ZAR"]) moneyTag = @"R";
    if ([moneyCode isEqualToString:@"DJF"]) moneyTag = @"DJ.FS";
    if ([moneyCode isEqualToString:@"SOS"]) moneyTag = @"Sh.So";
    if ([moneyCode isEqualToString:@"KES"]) moneyTag = @"K.Sh";
    if ([moneyCode isEqualToString:@"UGS"]) moneyTag = @"U.Sh";
    if ([moneyCode isEqualToString:@"TZS"]) moneyTag = @"T.Sh";
    if ([moneyCode isEqualToString:@"RWF"]) moneyTag = @"RF";
    if ([moneyCode isEqualToString:@"BIF"]) moneyTag = @"F.Bu";
    if ([moneyCode isEqualToString:@"ZRZ"]) moneyTag = @"Z";
    if ([moneyCode isEqualToString:@"ZMK"]) moneyTag = @"KW";
    if ([moneyCode isEqualToString:@"MCF"]) moneyTag = @"F.Mg";
    if ([moneyCode isEqualToString:@"SCR"]) moneyTag = @"S.RP(S)";
    if ([moneyCode isEqualToString:@"MUR"]) moneyTag = @"Maur.Rp";
    if ([moneyCode isEqualToString:@"ZWD"]) moneyTag = @"FZIM.$";
    if ([moneyCode isEqualToString:@"KMF"]) moneyTag = @"Com.F";
    
    
    return moneyTag;
}

總結(jié)辛苦,記得點贊?

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末减细,一起剝皮案震驚了整個濱河市匆瓜,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌萧吠,老刑警劉巖拇砰,帶你破解...
    沈念sama閱讀 211,194評論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件除破,死亡現(xiàn)場離奇詭異琼腔,居然都是意外死亡,警方通過查閱死者的電腦和手機展姐,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,058評論 2 385
  • 文/潘曉璐 我一進店門圾笨,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人板鬓,你說我怎么就攤上這事俭令〕唬” “怎么了瓢湃?”我有些...
    開封第一講書人閱讀 156,780評論 0 346
  • 文/不壞的土叔 我叫張陵绵患,是天一觀的道長。 經(jīng)常有香客問我,道長,這世上最難降的妖魔是什么鹰服? 我笑而不...
    開封第一講書人閱讀 56,388評論 1 283
  • 正文 為了忘掉前任套菜,我火速辦了婚禮,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘旷祸。我一直安慰自己讼昆,他們只是感情好闰围,可當我...
    茶點故事閱讀 65,430評論 5 384
  • 文/花漫 我一把揭開白布么夫。 她就那樣靜靜地躺著邢滑,像睡著了一般腐螟。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上困后,一...
    開封第一講書人閱讀 49,764評論 1 290
  • 那天乐纸,我揣著相機與錄音,去河邊找鬼摇予。 笑死汽绢,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的侧戴。 我是一名探鬼主播宁昭,決...
    沈念sama閱讀 38,907評論 3 406
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼酗宋!你這毒婦竟也來了积仗?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,679評論 0 266
  • 序言:老撾萬榮一對情侶失蹤蜕猫,失蹤者是張志新(化名)和其女友劉穎寂曹,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體回右,經(jīng)...
    沈念sama閱讀 44,122評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡隆圆,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,459評論 2 325
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了翔烁。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片渺氧。...
    茶點故事閱讀 38,605評論 1 340
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖租漂,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情颊糜,我是刑警寧澤哩治,帶...
    沈念sama閱讀 34,270評論 4 329
  • 正文 年R本政府宣布,位于F島的核電站衬鱼,受9級特大地震影響业筏,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜鸟赫,卻給世界環(huán)境...
    茶點故事閱讀 39,867評論 3 312
  • 文/蒙蒙 一蒜胖、第九天 我趴在偏房一處隱蔽的房頂上張望消别。 院中可真熱鬧,春花似錦台谢、人聲如沸寻狂。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,734評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽蛇券。三九已至,卻和暖如春樊拓,著一層夾襖步出監(jiān)牢的瞬間纠亚,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,961評論 1 265
  • 我被黑心中介騙來泰國打工筋夏, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留蒂胞,地道東北人。 一個月前我還...
    沈念sama閱讀 46,297評論 2 360
  • 正文 我出身青樓条篷,卻偏偏與公主長得像骗随,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子拥娄,可洞房花燭夜當晚...
    茶點故事閱讀 43,472評論 2 348

推薦閱讀更多精彩內(nèi)容