momoelz Posted February 19, 2011 Author Share Posted February 19, 2011 For that little question I have to make a post lol anyways I am amateur in vbbut how do i convert 12354,58469to 12354 ? without commas after it? Link to comment Share on other sites More sharing options...
BillyM Posted February 19, 2011 Share Posted February 19, 2011 You're not exactly clear on what you're asking to do.12354,58469You just want to grab the 12354 and completely forget about 58469 to leave yourself with 12354?If that's what you're asking, this is one way to do it. I'm assuming 12354,58469 is held in a string variable. I'll name that variable "moelz". I'll name the new string that holds 12354 as "newMoelz"```Dim num as integerDim moelz as stringDim newMoelz as stringmoelz = "12354,58469"number = InStr(moelz, ",")newMoelz= Left(newMoelz, num - 1)```newMoelz will now be "12354" Link to comment Share on other sites More sharing options...
Joyce Posted February 19, 2011 Share Posted February 19, 2011 ```number = InStr(moelz, ",")```Should be```num = InStr(moelz, ",")```You declared it as Num, and the line setting the new string value uses Num as well.:) Link to comment Share on other sites More sharing options...
BillyM Posted February 19, 2011 Share Posted February 19, 2011 Woops. Thanks Yami =) Link to comment Share on other sites More sharing options...
momoelz Posted February 20, 2011 Author Share Posted February 20, 2011 oki thx a lot in php it would be a lot simplier xD Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now