I have got a website that shows the money field in local currency for each different region the website is used in. I use the following code to set the right format for a locale (VB.NET):
Case 6 ' Turkey
_amount = Amount.ToString("c0", CultureInfo.CreateSpecificCulture("tr-TR"))
Now the problem is, on my localhost it correctly shows "TL" for Turkish Lira but on my staging deployment server it displays "YTL" which is New Turkish Lira which infact is the old currency symbol and the letter "Y" has been dropped since January 2009 [Source:Wikipedia]. So it should just display "TL". My server's regional settings seem to be fine i.e. they display "TL" for Turkish currency symbol, but I can't figure out where else currency settings can be obtained from. The same code is working in 2 different ways, I will appreciate any insight into this problem.
Related
We have a Xamarin Forms app.
We have a few existing users which had been using the app since last year where the database file name is MyAppName.db
Our new app strategy requires us to include the .db (Sqlite) along with the app to ensure we can include persistent information and does not require internet when you install the app, meaning we hope to overwrite the db file for existing users.
After we publish this new change where the database file is now MyNewDbFile.db, our users complain that they do not see any data, the app does not crash tough.
We capture error reports and we can see a common error in the our tool stating about "row value missused", a quick search indicates the value are not present and so the "SELECT * FROM TABLE WHERE COLUMNAME" query does not work causing the exception.
We can confirm we are using
Xamarin.Forms version 4.5.x
sqlite-net-sqlcipher version 1.6.292
We do not have any complex logic and cannot see a very specific reason causing this as this is not produced when we test our apps from the Alpha channel or the TestFlight.
We investigated the heart of the problem and can confirm that the troublemaker is the device Culture information.
We have been testing with English as the device language, however the minute the app is used by folks with any other language except English the query causes exception.
We make use of the Xamarin Essentials library to get device location (which is optional).
The latitude and longitude returned are culture specific.
So if you are using a Spanish language on device, the format for the Latitude and Longitude information is a , (comma) and NOT a . (dot).
That is, a Latitude value is something similar to 77.1234
where it is separated by a . (dot)
However for users with different region settings on device, the format would change to
77,1234 as value where it is separated by a , (comma).
The query requires us to have the values as string and that when not separated by a . (dot) fails to execute:
Query:
if (deviceLocation != null)
queryBuilder.Append($" ORDER BY((Latitude - {deviceLocation.Latitude})*(Latitude - {deviceLocation.Latitude})) +((Longitude - {deviceLocation.Longitude})*(Longitude - {deviceLocation.Longitude})) ASC");
Where the deviceLocation object is of type Xamarin.Essentials.Location which has double Latitude and Longitude values but when used as a string or even if you explicitly do deviceLocation.Latitude.ToString(), it would return the formatted values as per the device CultureInfo.
We can confirm that the problem is due to a mismatch of the format type and causing the query to throw an exception and in return making the experience as if there is no data.
Trying to get the Title for "Blood Oath" from 1990 https://www.imdb.com/title/tt0100414/ .In this example am using Jupyter, but it works the same in my .py program:
movie = ia.get_movie('0100414')
movie
<Movie id:0100414[http] title:_Prisoners of the Sun (1990)_>
Am I doing something wrong? This seems to be the 'USA aka' title. I do know how to get the AKA titles back via the API, but just puzzled as to why it's returning this one. On the IMDB web page "Blood Oath" is listed - under the AKA section - as the "(original title)". Thank you.
What you do is correct.
IMDbPY takes the movie title from the value of a meta tag with property set to "og:title". So, what's considered the title of a movie depends on the decisions made by IMDb.
You can also use "original title" key, that is taken from what it's actually shown to the reader of the web page. This, however, is even more subject to change since it's usually shown in the language guessed by the IMDb web servers using the language set by a registered user, the settings of your browser or by geolocation of the IP.
So, for example, for that title I get "Blood Oath" via browser since my browser is set to English and "Giuramento di sangue (1990)" if I access movie['original title'] (geolocation of my IP, I guess)
To conclude, if you really need another title, you may get the whole list this way:
ia.update(movie, 'release info')
print(movie.get('akas from release info'))
You will get a list that you can parse looking for a string ending in '(original title)'
(disclaimer: I'm one of the main authors of IMDbPY)
In google analytics admin, I've chosen 'objectives' -> 'payment made' and defined the objective detail as "regular expression" and entered '/step-4.html' in the text box.
This is because and the end of my shopping cart the URL contains somewhere 'step-4.html' in it.
However, when analysing the reports, this objective is never met although there were some sales and test orders that reached this page.
Also, in admin, I've activated the e-commerce definitions but my conversions are always zero in the reports.
Why is this and how can I fix this?
I presume you are talking about a destination goal, so if your page ends in "/step-4.html" with anything else in front, then it should be:
.*\/step-4\.html$
If that string is somewhere else in the URL (and not at the very end), then you just have to replace the $ with .*.
(Note that I've escaped forward slashes and dots.)
You should be able to see conversions in Real-Time reports if all is working.
How should I specify timezones for Word Clock in Bosun config?
I think there was some parameter for that but I can't find reference in docs for that.
The configuration parameter for the worldclock links is timeAndDate. Note this ONLY controls the links generated when displaying datetimes and doesn't control Bosun's timezone, which is hardcoded to UTC.
In the code:
TimeAndDate []int // timeanddate.com cities list
So our config file looks like:
timeAndDate = 202,75,179,136
Which adds Portland, Denver, New York, and London to the datetime links generated in alerts:
See http://www.timeanddate.com/worldclock/converter-about.html for how to get a list of Cities, and then you will find the p_=### codes in the URL that you can add to your Bosun config.
I've created an issue in the github issue tracker to get this fixed.
I have an ASP.Net application which takes the current time using "DateTime.UTCNow".
While I am accessing the page from the application server itself it shows the time in the format : M/dd/yyyy (10/22/2013 6:45:18 AM)
But if I tries to access this page from another machine/client it shows the format as dd/M/yyyy (22/10/2013 2:44:24 AM).
As a result when I parse this time I am getting error - "String was not recognized as a valid DateTime." in one machine But it works fine in the other machine(server itself).
Please help me to resolve this issue.
Thanks in advance
Siva
In your code every time you read the time, format in M/dd/yyyy eg:
time = DateTime.Now.ToString("M/dd/yyyy"); ///time is the time you read from PC
try this,
var time = DateTime.UtcNow.ToString("MM/dd/yyyy hh:mm:ss tt", System.Globalization.CultureInfo.InvariantCulture);
Try with
time = DateTime.Now.ToShortTimeString();
I have had the same issue. Try setting the regional settings on the client machine to the same as that of the server. It worked for me
EDIT :i want to set my regional setting to english (UK) on load of my program how can i do so?
This should set you on the right path with regional settings