I added a textString property to store map co-ordinates to a document type "Contact".
In my contactService, I am getting some encoded value for the negative sign while getting the latitude contact.Latitude.
var contact = umbracoContextReference.UmbracoContext.Content?.GetById(Convert.ToInt32(id)) as Contact;
Convert.ToDecimal({contact.Latitude}, CultureInfo.InvariantCulture) is working fine for positive decimals. It throws exception on negative decimals for ex. "−25.38273460".
I tried applying NumberStyles
decimal.Parse(contact.Longitude, System.Globalization.NumberStyles.AllowParentheses |
System.Globalization.NumberStyles.AllowLeadingWhite |
System.Globalization.NumberStyles.AllowTrailingWhite |
System.Globalization.NumberStyles.AllowThousands |
System.Globalization.NumberStyles.AllowDecimalPoint |
System.Globalization.NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture);
also simple string Replace("−", "-"), Regex.UnEscape(). It didnt work either.
Kindly suggest a solution