Click here to Skip to main content
15,899,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
im doin a project , which is a restaurant management system. at which point i want to display some currency in the form of Srilankan rupees. with the code i have, it only shows the currency as us dollars. pls tell me how to represent currency in srilankan rupees.

What I have tried:

lbldrinkcost.Text = String.Format("{0 :C2}" , drinkcost);
Posted
Updated 10-Jul-20 23:40pm
Comments
BillWoodruff 11-Jul-20 7:53am    
Consider letting the user select a specific culture for the current session.
achalake 13-Jul-20 0:06am    
Thank you for your advise

1 solution

Set your Locale and Culture to Sri Lankra - either in the system configuration or in your app: CultureInfo.CurrentCulture Property (System.Globalization) | Microsoft Docs[^]

But ... generally speaking it's a poor idea: you should be using the user's preferred culture rather than forcing one upon him, and changing the Culture can affect number display formats, how dates are shown, and so forth as well as the currency.

It is possible to do this on a "string by string" basis, but it's a fair amount of work: c# - How to get specific culture currency pattern - Stack Overflow[^]
 
Share this answer
 
Comments
achalake 13-Jul-20 0:16am    
im really sry i do not understand yur solution. its just that im really new to coding and just want to represent a program that is used in a restaurant in my country. yur solution maybe authentic but its just becos of my ignorance i cannot comprehend it. if u were to explain it in much more simple terms i wud be immensely grateful....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900