c#,internationalization,culture,currency-formatting
If I understood you correctly, isn't this what you want? var price = new Decimal(49.9); var cultureInfo = new CultureInfo("da-DK"); //var currentCultureInfo = new CultureInfo(CultureInfo.CurrentCulture.Name); var test = string.Format(cultureInfo, "{0:C2}", price); ...
string,parsing,powershell,datetime,culture
The Filter parameter is a string not scriptblock. It is working with a scriptblock in those other cases because the string form of script block is the text of the block without the surrounding braces. However, in this case, you need the variable to be substituted in the filter. Try...
c#,.net,culture,date-formatting
This is explicitly handled in the source. It makes sense, too. Debug output should not be affected by the end-users culture; you want your debug logs to be consistent no matter where the code is running....
WPF does indeed default to US, regardless of the System setings. You can do an application-wide setting in App.Xaml.cs : public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { // Thread settings are separate and optional // affect Parse and ToString: // Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("nl-NL");...
c#,string,date,date-format,culture
Your string format is wrong. It has to match your string format exactly. You can use dd-MMM-yy hh:mm:ss tt format instead. Here an example in LINQPad. string s = "16-Aug-78 12:00:00 AM"; var date = DateTime.ParseExact(s, "dd-MMM-yy hh:mm:ss tt", CultureInfo.InvariantCulture); date.Dump(); Custom Date and Time Format Strings Or, since dd-MMM-yy...
c#,asynchronous,asp.net-identity,culture
The purpose of this is to run the continuation with the current culture settings although it might run on a different thread. But we don't want to modify the culture of that thread in a persistent way because we don't own that thread. It's shared. So we must restore the...
c#,time,timepicker,phone,culture
I assume you have a System.Windows.Forms.DateTimePicker. If so, you need not change the culture on the current thread - you can just use the CustomFormat property, e.g. public void SetCustomFormat(DateTimePicker dateTimePicker, bool twentyFourHour) { dateTimePicker.ShowUpDown = true; dateTimePicker.Format = DateTimePickerFormat.Custom; dateTimePicker.CustomFormat = twentyFourHour ? "HH:mm" : "hh:mm tt"; } Note:...
c#,asp.net-web-api,globalization,cultureinfo,culture
Which culture is trying to be supported Place a try / catch around the offending line and catch the exception. Place a break point inside the catch block and debug your code. Examine the thrown CultureNotFoundException's InvalidCultureName property. This will tell you which Culture is trying be used but...
c#,string,search,stringbuilder,culture
So why not copy the whole document to a stringbuilder first, the use 1 ToString(). Then just use a similar scheme to iterate over all the possible values. Use compareInfo.Compare(criteria.Text, 0, criteria.Text.Length, docString, startIndex, checkLength)
You can read about NumberStyles in the documentation. Essentially it allows you to specify what sort of text will parse. If you want to be as flexible as possible, then NumberStyles.Any is the 'widest' option. Convert.ToInt32 is equivalent to using int.Parse and Convert.ToDecimal is equivalent to using decimal.Parse - they...
javascript,formatting,locale,culture
When you use Number.toFixed() you obtain a string (not a number any more). For that reason, subsequent calls to .toLocaleString() launch the generic Object.toLocaleString() method that knows nothing about numbers, instead of the Number.toLocaleString() you want. Having a look at the documentation we can compose something like this (tested in...
It should be, per datapicker options: $('#myDatepicker').datepicker({ momentConfig: { culture: 'fr', format: 'L' } }); However, this will only set the format of the input box--not the calendar. I'm not sure if there is a way to have the calendar start on Monday (you can change the day names at...
Alright, a college of mine told me a solution. At least it sounds logic to me: The col itself is from type date which is a short version of dateTime. When using a clear select like SELECT date FROM mytable the output will come as a DateTime. Thats why I...
asp.net,asp.net-mvc,datetime,culture
In your model, you can set the DeliveryDate as string public string DeliveryDate { get; set; } Then in your view. you can add a textbox for your model that will turn into a datetimepicker control, through the use of jQuery. The html for the textbox: <div> @Html.TextBoxFor(model => Model.DeliveryDate,...
c#,reporting-services,culture,rdl
Short Answer Instead of FormatDateTime, you could use Format and specify your expected output format: =First(Format(Fields!SomeDate.Value, "dd.MM.yyyy")) Or another alternative to have the culture in a parameter, but in this case you will have to read the long answer. Long answer Your first attempt with the SetExecutionParameters was to set...
c#,datetime,culture,currentculture
Try this: DateTime date = DateTime.ParseExact("01/06/2015", "dd/MM/yyyy", CultureInfo.InvariantCulture); If you don't specify the culture it will use whatever your current culture settings are. Since you know the format you should supply InvariantCulture....
The "d" standard format specifier uses ShortDatePattern of supplied culture. Since you use DateTime.ParseExact, format and string should match exactly. Buthr-HR culture's ShortDatePattern pattern is d.M.yyyy. and this clearly doesn't match with your string. It doesn't match with InvariantCulture either. However, this format is a standard date and time format...
c#,json,formatting,cultureinfo,culture
You should not localize your JSON - see http://www.json.org for the spec (which only shows the dot as a separator) and How to localize when JSON-serializing? for a similar question. I wouldn't recommend trying to read your customized JSON - it may sound like a quick win right now, but...
c#,string,unicode,indexof,culture
The behavior makes perfect sense to me. You are using a combining character, which is combined with the preceding character, turning it into a different character, one which won't match the '\\' character you've specified at the end of your search string. That prevents the entire string you're looking for...
c#,string,datetime,string-formatting,culture
The issue is because of ignored culture value in String.Format and not with converting string to DateTime. You need: srRegisterDate = String.Format(culture, "{0:dddd, MMMM d, yyyy}", Convert.ToDateTime(srRegisterDate)); Your current call to String.Format utalizes the overload String.Format Method (String, Object[]) and the culture passed in parameter is treated as a simple...
c#,asp.net,sql-server,iis,culture
My guess is that you have a mismatch with the culture on the SQLServer and the IIS. The SQLServer (maybe) returns doubles that uses the american culture (1.23), but your IIS is running under a different culture, that uses doubles with a comma instead (1,23). This will make the TryParse...