string asLocalCurrency(int intMoney) { return (num / 100m).ToString("c"); //eg 12345 becomes €123.45 for me } string asSomeLocalCurrency(int intMoney, CultureInfo cInfo) { return (num / 100m).ToString("c", cInfo); // eg 12345 with InvariantCulture is ¤123.45 }
But. This means that £ 123.45 is $ 123.45 or € 123.45, which is clearly wrong.
The problem then is that the Peso / Dollar $$ sign can be used to represent NIO, AUD, CAD, TOP, USD, HKD and more. This is not the only symbol that sees use in several places. If you record old payments, even things like £ used for IEP and ITL (no longer in use) can be a problem.
The same can be said of the fact that you store the values as integer numbers of a percentage that do not apply to all currencies.
Cash value only makes sense with implied or explicit currency. Here you take one that either does not, or you replace the implied with the explicit, or you depend on a very large part of the overriding logic to make everything right.
The last one may work, but is fraught. The other two are simply mistaken.
Finally, culture at best tells you which people people are most familiar with, but not what they will always use. I often use kroner and øre, but I use Hiberno-English when using them anyway.
I would recommend storing ISO 4217 codes along with currencies. It is a good idea to have it somewhere in the final score. The symbol is good for prettiness, the code is good for things to be accurate.
Ignore the user's culture, with the possible exception of a better guess by default. (for example, if they are Americans, then they probably want to use US dollars, but they may not want to). There are not many currencies in the world, so here is a list of all bars with several specialized cases of international use:
AED United Arab Emirates Dirham د.إ AFN Afghan Afghani ؋ ALL Albanian Lek L AMD Armenian Dram դր ANG Netherlands Antillean Guilder ƒ AOA Angolan Kwanza Kz ARS Argentine Peso $ AUD Australian Dollar $ AWG Aruban Florin ƒ AZN Azerbaijani Manat man. BAM Bosnia and Herzegovina Convertible Mark KM BBD Barbados Dollar $ BDT Bangladeshi Taka ৳ BGN Bulgarian Lev BHD Bahraini Dinar .د.ب BIF Burundian Franc FBu BMD Bermudian Dollar $ BND Brunei Dollar $ BOB Boliviano Bs. BRL Brazilian Real R$ BSD Bahamian Dollar $ BTN Bhutanese Ngultrum Nu. BWP Botswana Pula P BYR Belarusian Ruble Br BZD Belize Dollar $ CAD Canadian Dollar $ CDF Congolese Franc FC CHF Swiss Franc Fr. CLP Chilean Peso $ CNY Chinese Yuan ¥ COP Colombian Peso $ CRC Costa Rican Colon ₡ CUC Cuban convertible Peso $ CUP Cuban Peso $ CVE Cape Verde Escudo $ CZK Czech Koruna Kč DJF Djiboutian Franc Fdj DKK Danish Krone kr DOP Dominican Peso $ DZD Algerian Dinar د.ج EEK Estonian Kroon kr EGP Egyptian Pound ج.م ERN Eritrean Nakfa Nfk ETB Ethiopian Birr Br EUR Euro € FJD Fiji Dollar $ FKP Falkland Islands Pound £ GBP Pound Sterling (British Pound) £ GEL Georgian Lari lari GHS Ghanaian Cedi ₵ GIP Gibraltar Pound £ GMD Gambian Dalasi D GNF Guinean Franc FG GTQ Guatemalan Quetzal Q GYD Guyanese Dollar $ HKD Hong Kong Dollar $ HNL Honduran Lempira L HRK Croatian Kuna kn HTG Haitian Gourde G HUF Hungarian Forint Ft IDR Indonesian Rupiah Rp ILS Israeli New Sheqel ₪ INR Indian Rupee Rs IQD Iraqi Dinar د.ع IRR Iranian Rial ﷼ ISK Icelandic Króna kr JMD Jamaican Dollar $ JOD Jordanian Dinar JD JPY Japanese Yen ¥ KES Kenyan Shilling Ksh KGS Kyrgyzstani Som som KHR Cambodian Riel ៛ KMF Comoro Franc CF KPW North Korean Won ₩ KRW South Korean Won ₩ KWD Kuwaiti Dinar د.ك KYD Cayman Islands Dollar $ KZT Kazakhstani Tenge ₸ LAK Lao Kip ₭ LBP Lebanese Pound ل.ل LKR Sri Lanka Rupee Rs LRD Liberian Dollar $ LSL Lesotho Loti M LTL Lithuanian Litas Lt LVL Latvian Lats Ls LYD Libyan Dinar ل.د MAD Moroccan Dirham د.م. MDL Moldovan Leu leu MGA Malagasy Ariary ariary MKD Macedonian Denar MMK Myanma Kyat K MNT Mongolian Tögrög (Tugrik) ₮ MOP Macanese Pataca 毫MRO Mauritanian Ouguiya UM MUR Mauritian Rupee R MVR Maldivian Rufiyaa .ރ MWK Malawian Kwacha MK MXN Mexican Peso $ MYR Malaysian Ringgit RM MZN Mozambican Metical MTn NAD Namibian Dollar $ NGN Nigerian Naira ₦ NIO Nicaraguan Cordoba Oro C$ NOK Norwegian Krone kr NPR Nepalese Rupee रू. NZD New Zealand Dollar $ OMR Omani Rial ر.ع. PAB Panamanian Balboa ฿ PEN Peruvian Nuevo Sol S/. PGK Papua New Guinean Kina K PHP Philippine Peso ₱ PKR Pakistani Rupee Rs PLN Polish Zloty zł PYG Paraguayan Guaraní ₲ QAR Qatari Rial ر.ق RON Romanian New Leu lei RSD Serbian Dinar RUB Russian Rouble RWF Rwandan Franc RF SAR Saudi Riyal ر.س SBD Solomon Islands Dollar $ SCR Seychelles Rupee SRe SDG Sudanese Pound SDG SEK Swedish Krona kr SGD Singapore Dollar $ SHP Saint Helena Pound £ SLL Sierra Leonean Leone Le SOS Somali Shilling So. Sh. SRD Surinamese Dollar $ STD São Tomé and Príncipe Dobra Db SYP Syrian Pound SYP SZL Lilangeni E THB Thai Baht ฿ TJS Tajikistani Somoni TJS TMT Turkmenistani Manat m TND Tunisian Dinar د.ت TOP Tongan Paʻanga T$ TRY Turkish Lira TL TTD Trinidad and Tobago Dollar $ TWD New Taiwan Dollar $ TZS Tanzanian Shilling TZS UAH Ukrainian Hryvnia ₴ UGX Ugandan Shilling Ush USD United States Dollar $ UYU Uruguayan Peso $ UZS Uzbekistan Som som VEF Venezuelan Bolívar Fuerte Bs. F VND Vietnamese Ðồng ₫ VUV Vanuatu Vatu Vt WST Samoan Tala WS$ XAF CFA Franc BEAC FCFA XCD East Caribbean Dollar $ XOF CFA Franc BCEAO CFA XPF CFP Franc F YER Yemeni Rial rial ZAR South African Rand R ZMK Zambian Kwacha ZK ZWL Zimbabwe Dollar $
Oh look. Zimbabwe had its own dollar the last time I updated. What can happen faster, do you drop it from the list or upgrade the infrastructure for this?