i’m stuck and cannot find easy way to solve this issue, let’s suppose i have below model:
public classs FooModel
{
string name{get;set;}
double doubleFoo{get;set}
}
i have built a class, usable from a HTMLform, where user can upload an excel file and fill above value (with OpenXML). Let’s say this class return a “FooObject”, with properties from FooModel.
FooModel FooObject = new FooModel()
{
name = nameFromFooObject,
doubleFoo = doubleFooFromObject, /* <= this variable contains well dot decimal separation, and look like "0.061065380952380954" */
}
I have checked, doubleFoo that i get from excel file is dot separated value.
Now, my controller return a view, where a form is populated with value sent from Excel file.
<form asp-action="FooAdd">
<div>
<label asp-for="name" class="control-label"></label>
<input asp-for="name" class="form-control"/>
<span asp-validation-for="name" class="text-danger"></span>
</div>
<div>
<label asp-for="doubleFoo " class="control-label"></label>
<input asp-for="doubleFoo " class="form-control"/>
<span asp-validation-for="doubleFoo " class="text-danger"></span>
</div>
</form>
form once populated with object sent from excel
here come the trouble, doubleFoo is now showed on my form with comma separation like “0,061065380952380954”, and i can’t send the form to add object to database.
Why ? How can i easily solve this ?
tried several from stackoverflow without success