1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

vb.net 2013 - double?

Discussion in 'Visual Basic ( VB )' started by 1912Dummy, May 27, 2014.

  1. 1912Dummy

    1912Dummy New Member

    Joined:
    Mar 29, 2013
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    0
    hello,

    does anyone know how i can convert a double without a negative ()

    it seems i get (£50.00) - this is a negative value

    but i like to have it as -£50.00

    i use:

    Code:
    Dim l As Double
    l = cDAL.VarToDbl(Label6.Text + Amount1) 'amount1 is a double
    lblrunning.Text =  Format(l, "c")
    
    cDAL:
    Code:
    Public Shared Function VarToDbl(ByVal o As Object) As Decimal
    
            Try
                Return Decimal.Parse(o.ToString)
            Catch
                Return 0
            End Try
    
        End Function
    
    thank you
     

Share This Page