pluton Active Member Licensed User Longtime User Jan 15, 2013 #1 OK I don't know why because I didn't test it before but today I noticed when you have number like 007 it always show without zeroes. It shows 7 Here is little code: Code: Copy Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim IdInt As Int Dim IdString As Int Dim IdFloat As Float Dim IdDouble As Double IdInt = 007 IdString = 007 IdFloat = 007 IdDouble = 007 End Sub Sub Activity_Create(FirstTime As Boolean) Msgbox("IdInt: " &IdInt _ &CRLF& _ "IdString: " &IdString _ &CRLF& _ "IdFloat: " &IdFloat _ &CRLF& _ "IdDouble: " &IdDouble,"OK") End Sub And here's what I got on emulator and phone: or
OK I don't know why because I didn't test it before but today I noticed when you have number like 007 it always show without zeroes. It shows 7 Here is little code: Code: Copy Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim IdInt As Int Dim IdString As Int Dim IdFloat As Float Dim IdDouble As Double IdInt = 007 IdString = 007 IdFloat = 007 IdDouble = 007 End Sub Sub Activity_Create(FirstTime As Boolean) Msgbox("IdInt: " &IdInt _ &CRLF& _ "IdString: " &IdString _ &CRLF& _ "IdFloat: " &IdFloat _ &CRLF& _ "IdDouble: " &IdDouble,"OK") End Sub And here's what I got on emulator and phone: or
M Mahares Expert Licensed User Longtime User Jan 15, 2013 #2 If you declare them as strings, you will get your zeros: Code: Copy Dim IdInt As String Dim IdString As String Dim IdFloat As String Dim IdDouble As String IdInt = "007" IdString = "007" IdFloat = "007" Upvote 0
If you declare them as strings, you will get your zeros: Code: Copy Dim IdInt As String Dim IdString As String Dim IdFloat As String Dim IdDouble As String IdInt = "007" IdString = "007" IdFloat = "007"
mc73 Well-Known Member Licensed User Longtime User Jan 15, 2013 #3 Yes. 007=7 so no surprise you get these results,actually I would be surprised if you get something different. If you need a '007' to be displayed, you can always use the string representation, for e.g. dim s as string:s="007". Also, you can try the numberFormat functions. Upvote 0
Yes. 007=7 so no surprise you get these results,actually I would be surprised if you get something different. If you need a '007' to be displayed, you can always use the string representation, for e.g. dim s as string:s="007". Also, you can try the numberFormat functions.
pluton Active Member Licensed User Longtime User Jan 15, 2013 #4 Yes my bad. I just notice that I Dim IdString as Int and I meant As String : palmface : I test all but type it wrong. Upvote 0
Yes my bad. I just notice that I Dim IdString as Int and I meant As String : palmface : I test all but type it wrong.
R Reinosoft Member Licensed User Longtime User Jan 15, 2013 #5 a Int, Float and Double are numbers the only way to show the double zero is to create a string (i think you made the mistake to DIM idString as int; instead of dimming it as String) if you use: Dim idString as string idString = "007" it will definately work! Upvote 0
a Int, Float and Double are numbers the only way to show the double zero is to create a string (i think you made the mistake to DIM idString as int; instead of dimming it as String) if you use: Dim idString as string idString = "007" it will definately work!
ilan Expert Licensed User Longtime User Jul 26, 2013 #6 try this Code: Copy Dim IdInt As Int Dim IdString As Int Dim IdFloat As Float Dim IdDouble As Double IdInt = NumberFormat(007,3,0) IdString = NumberFormat(007,3,0) IdFloat = NumberFormat(007,3,0) IdDouble = NumberFormat(007,3,0) Upvote 0
try this Code: Copy Dim IdInt As Int Dim IdString As Int Dim IdFloat As Float Dim IdDouble As Double IdInt = NumberFormat(007,3,0) IdString = NumberFormat(007,3,0) IdFloat = NumberFormat(007,3,0) IdDouble = NumberFormat(007,3,0)