0
I am developing an ASP.NET application where I need to take a DOBULE typed by the user and pass to the bank.
However there is a divergence of information, the DOUBLE of my bank receives separator with Comma "123,456" and the application passes with Point "123,456", but when the bank receives "." it ignores, so it turns a value "123.456" into "123456"
How can I fix it?
MODEL:
public class Friend
{
public int Id { get; set; }
public string Nome { get; set; }
public string Rua { get; set; }
public string Cidade { get; set; }
public string Estado { get; set; }
public string Pais { get; set; }
[Required]
public double Latitude { get; set; }
[Required]
public double Longitude { get; set; }
}
Migration:
migrationBuilder.CreateTable(
name: "Friend",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Nome = table.Column<string>(nullable: true),
Rua = table.Column<string>(nullable: true),
Cidade = table.Column<string>(nullable: true),
Estado = table.Column<string>(nullable: true),
Pais = table.Column<string>(nullable: true),
Latitude = table.Column<double>(nullable: false),
Longitude = table.Column<double>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Friend", x => x.Id);
});
Prints:
how your bank is configured.
– novic
Hello, I don’t know much so I don’t know how to answer you right, But since I didn’t touch any configuration after I installed it, I believe it’s Default
– Marcelo Bittar
So you have to check the default of the database and the default of the application this has to be the same, we usually configure en in the application and it sends the data correctly to the database, but, this all depends if it is configured, it is a very local problem
– novic
Okay, you can tell me where I change it?
– Marcelo Bittar
This one is in the validation that has to be replaced "." by "," is in the jQuery package. because I do not have in hands more by seeing the bank is recording correctly, it is problem on the same front
– novic
The bank shouldn’t record with "." instead of ","?
– Marcelo Bittar
The bank when it is well configured yes, is usually in the American layout, but, has to configure in several ways. As it runs away from us have to check how it was installed and configured.
– novic
I looked for some Jquery validation that could reference "." /"," from Double, but unfortunately I couldn’t find anything :/
– Marcelo Bittar