G grafix4all Member Licensed User Longtime User Feb 19, 2015 #1 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)
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)
Erel B4X founder Staff member Licensed User Longtime User Feb 19, 2015 #2 Code: Copy Sub Activity_Create(FirstTime As Boolean) Log(MyFormat(199)) End Sub Sub MyFormat(d As Double) As String Dim s As String = NumberFormat2(d, 0, 2, 2, False) Return s.Replace(".", ",") End Sub Upvote 0
Code: Copy Sub Activity_Create(FirstTime As Boolean) Log(MyFormat(199)) End Sub Sub MyFormat(d As Double) As String Dim s As String = NumberFormat2(d, 0, 2, 2, False) Return s.Replace(".", ",") End Sub
Douglas Farias Expert Licensed User Longtime User Nov 4, 2015 #3 @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? Upvote 0
@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?
M Mahares Expert Licensed User Longtime User Nov 4, 2015 #4 Change this: Code: Copy Dim s As String = NumberFormat2(d, 0, 2, 2, False) to this: Code: Copy Dim s As String = NumberFormat2(d, 1, 2, 2, False) Upvote 0
Change this: Code: Copy Dim s As String = NumberFormat2(d, 0, 2, 2, False) to this: Code: Copy Dim s As String = NumberFormat2(d, 1, 2, 2, False)
Douglas Farias Expert Licensed User Longtime User Nov 4, 2015 #5 haha really noob i m. thx @Mahares Upvote 0