REMOVE POINTS AND COMMAS VB.NET

Asked

Viewed 387 times

-2

Friends, Mysql does not correctly save the values with dots and commas in the currency format! i use VB.net and need a function to remove points and commas, before storing the value in the database!!

example: from 1,200.23 to 120023

In other words, I would like to use the coin mask, and use a function to remove the dots and commas before storing the value in the database!! I hope someone understands my problem, and helps me!

  • Replace? https://docs.microsoft.com/en-us/dotnet/api/system.string.replace?view=netframework-4.8

  • Why you don’t use the right type, both in the bank and in your application?

1 answer

0

You can do the following to remove the semicolons.

 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim dblValor As Double = 10000.58

    MsgBox(dblValor.ToString.Replace(",", "")) 'Tira a vírgula
    MsgBox(dblValor.ToString.Replace(".", "")) 'Tira o ponto
End Sub

Browser other questions tagged

You are not signed in. Login or sign up in order to post.