I'm running the ASP .NET application through Visual Studio. The latitude and longitude data are retrieved from an SQL Server database. The application works with no issue when run through Visual Studio localhost, but when i deploy it to IIS the data is displayed without the decimal point.
The data type in the database is a float.
TestTable modal class to retrieve the data from the database.
public class TestTable
{
public int ID { get; set; }
public string Product_Description { get; set; }
public int PolicyNo { get; set; }
public string Insured { get; set; }
public string TAB_Ratio { get; set; }
public string Broker_Name { get; set; }
public DateTime Policy_Inception_Date { get; set; }
public string Match { get; set; }
public string Detail_Address { get; set; }
public int Building_SI { get; set; }
public decimal Total_API_Outside { get; set; }
public decimal Rate { get; set; }
public decimal Total_Loss_Ratio { get; set; }
public decimal ThrdParty_Loss_ratio { get; set; }
public decimal ThrdParty_Attritional_Ratio { get; set; }
public double Lat { get; set; }
public double Long { get; set; }
}
Foreach to retrieve the data from the TestTable
@{ var mapCounter = 0;}
@foreach (var item in Model.TestTable) {
if(mapCounter < 200)
{
mapCounter++;
<text>
console.log(@item.Lat);
</text>
@:addMarker(@item.Lat, @item.Long, '@item.ID', '@item.Product_Description', '@item.Insured', '@item.TAB_Ratio', '@item.Broker_Name', '@item.PolicyNo', '@item.Match', '@item.Detail_Address', '@item.Building_SI', '@item.Total_API_Outside', '@item.Rate', '@item.Total_Loss_Ratio', '@item.ThrdParty_Loss_ratio', '@item.ThrdParty_Attritional_Ratio');
}
}
function to create markers based on the data from the database
function addMarker(latitude, longitude, title, description, insured, tab_ratio, broker_name, policy_inception, match, detail_address, building_si, total_api_outside, rate, total_loss_ratio, thrdparty_loss_ratio, thrdparty_attritional_ratio)
{
var latLng = new google.maps.LatLng(latitude, longitude);
var marker = new google.maps.Marker({
position: latLng,
title: title,
map: map,
icon: icon,
draggable: false
});
allMarkers.push(marker);
}
See the console for output.
Top image from Visual Studio. Bottom image from IIS server.
Thank you in advance.