Android Question Currency format

Discussion in 'Android Questions' started by grafix4all, Feb 19, 2015.

?

About how to show a value as currency

  1. Great

    2 vote(s)
    100.0%
  2. Great

    2 vote(s)
    100.0%
Multiple votes are allowed.
  1. grafix4all

    grafix4all Member Licensed User

    Im a newbie.
    I cant figure out how do I do This

    Dim MyMoney as Double
    Dim Label1 as Label

    MyMoney=199
    label1.text=Mymoney

    Label1 should show 199,00 (This is the Danish notation)
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Code:
    Sub Activity_Create(FirstTime As Boolean)
       
    Log(MyFormat(199))
    End Sub

    Sub MyFormat(d As Double) As String
       
    Dim s As String = NumberFormat2(d, 022False)
       
    Return s.Replace("."",")
    End Sub
     
  3. Douglas Farias

    Douglas Farias Expert Licensed User

    @Erel
    if the value start with 0 how can i change this?
    example i have 0.40 using your example the result is ",40" no 0,40
    my ideia its check if start with , add 0 at start but i dont know if this is the correct way.

    what can i make if value start with 0?
     
  4. Mahares

    Mahares Well Known Member Licensed User

    Change this:
    Code:
    Dim s As String = NumberFormat2(d, 022False)
    to this:
    Code:
    Dim s As String = NumberFormat2(d, 122False)
     
  5. Douglas Farias

    Douglas Farias Expert Licensed User

    DonManfred likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice