I am converting a double value to currency string format and it gets converted string with pound symbol currency. Is it culture dependent?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
This probably isn't the best/most efficient way to do this, but have the decimal you want to show pounds converted into a string and just replace the dollar sign with the pound sign
again this most likely isn't the best or most efficient way to do so, but its a work around to avoid having to change your computer settings.
Hope this helps! If not let me know and I'll remove the answer(I had to use an answer because I can't comment under 50 rep, otherwise I would have used a comment to get some more clarity before answering) Cheers!
If you always want to use a a specific locale, which may be desirable if your server target is hosted in a different timezone, etc... ToString() can be supplied with a CultureInfo argument.
How to convert string to double with proper cultureinfo
If you want to tailor it to the user's locale, You might be able to examine the request values:
Get CultureInfo from current visitor and setting resources based on that?