I have a an ASP.Net web site using vb.net code.In code behind file I am trying to populate the infowindow with content where I have to format a numeric variable to 2 decimal places.The variable is called from data in a connected sql server database.
The code I am using is
The above code works but I wish to format the value for 'Distance' from location {2} to two decimal places from the sql database value which is a calculated field producing a large unformatted numeric value.
I am therefore trying to format the content string within the htm code. Or should I be concentrating on getting the sql server database value formatted first before calling it in the content string.
Any advice welcomed
The code I am using is
Code:
overlayContents.Add(String.Format("{{ content: ""<div class=\""infoWindow\""><br /><br />{0}<br /><img src={1} height=120 width=100/><br />Distance:{2} Miles""}}", location("ID"), location("image"), location("DistanceFromAddress")))
I am therefore trying to format the content string within the htm code. Or should I be concentrating on getting the sql server database value formatted first before calling it in the content string.
Any advice welcomed