ASCII to FLOAT Extract

3 posts in this topic

Hello, I would like to know if there is a simple way to convert an ascii string of say "1500.7" into a float? I know I can use the ascii to int function and convert the first 4 characters which would give me 1500 as an integer. I was hoping I could just get 1500.7 straight into a float. 

My current method of doing this is to extract 1500 into an int and then extract the 7 into an int seperatley, I then divide the 7 portion of the number by 10 and add it to the 1500 to get my actual value.

Any help is appreciated, thanks.

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now