Latitude and longitude are with comma on a German language
Hi to all,
I'm using the 2.0.1 version and I noticed one issue (it took me 4h but who cares). I have a multilanguage site, and when I change to German version properties like Latitude and Longitude are with a comma (19,44534) and not point as it should be (19.44534). Google map stays greyed out as it can't parse those values.
I will try to update to 2.0.3, maybe this is already fixed.
I managed to fixed this issue by using ToString() to always translate to a specific culture, otherwise, it would translate decimal properties to comma version if you leave them in a razor with the active German language.
Thank you for your information, I just wanted to make others aware if they read your post that this issue has nothing to do with how Angular Google Maps displays or stores values internally (Its uses Invariant Culture throughout), but this issue is to do with how Razor displays a decimal value type - this is really is your responsibility and depends how you wish to consume the decimal values.
eg. @Model.Content.ShopLocation.Longitude and @Model.Content.ShopLocation.Latitude are decimal types and its up to you how you turn them into strings. Just in the same way, as a date being stored in a DateTime date type is your responsibility how you convert to a string.
Latitude and longitude are with comma on a German language
Hi to all,
I'm using the 2.0.1 version and I noticed one issue (it took me 4h but who cares). I have a multilanguage site, and when I change to German version properties like Latitude and Longitude are with a comma (19,44534) and not point as it should be (19.44534). Google map stays greyed out as it can't parse those values.
I will try to update to 2.0.3, maybe this is already fixed.
Thanks, Bojan
I managed to fixed this issue by using ToString() to always translate to a specific culture, otherwise, it would translate decimal properties to comma version if you leave them in a razor with the active German language.
Maybe this will help somebody.
Hi Bojan
Thank you for your information, I just wanted to make others aware if they read your post that this issue has nothing to do with how Angular Google Maps displays or stores values internally (Its uses Invariant Culture throughout), but this issue is to do with how Razor displays a decimal value type - this is really is your responsibility and depends how you wish to consume the decimal values.
eg.
@Model.Content.ShopLocation.Longitude
and@Model.Content.ShopLocation.Latitude
are decimal types and its up to you how you turn them into strings. Just in the same way, as a date being stored in a DateTime date type is your responsibility how you convert to a string.Cheers
Jonathan
is working on a reply...