how do i convert a VAR string to an Array? NOW a MATH problem
How can i convert a string that is a long into a array. I wish to convert a number 2263 into 22.63? so I was thinking that i convert 2263 into an array then manuplate the array so that i have 22.63.
Post Edited (grasshopper) : 6/18/2008 10:13:19 PM GMT
Post Edited (grasshopper) : 6/18/2008 10:13:19 PM GMT
Comments
Have a look at the format object in the object exchange, I think you'll find some routines in there that will do what you want.
obex.parallax.com/objects/230/
Regards,
Coley
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PropGFX Forums - The home of the Hybrid Development System and PropGFX Lite
But when I replace M with the value of
My math is all incorrect.
Please help me i have tryed several varations of the
i.e.
Mike my life saver:
I did as you asked but no luck. I got a negative [noparse][[/noparse] -264. ] when the number should be around 23.62.
Any thing else? Please help
I think it works fine the lm135 is not floating point, so i assume that i can just subtract the two. Please let me know your concerns. And thanks a million for the help.
It works as you requested and again i thank you for the wisdom that you reflect upon me. For the record, perhaps others will benefit the final code is below.
** as a side note the 2x20 display i am using does not like the F.S.Floattostring(slope) statement. It displays 5-6 characters after the number is shown. The characters are not any thing i have ever seen but i fix this by clearing the letters with more code after the F.F.Floattostring(slope) statement **
You didn't show how you positioned the output string on the LCD display. The "writestr" just puts out what's in the string and anything left on the display from before is left unchanged. You at least need to erase the rest of the current line. When I've done similar things, I save the pointer in a local variable and do STRSIZE on it to get the number of characters. I then output enough spaces to clear the rest of the current display line.
Post Edited (Mike Green) : 6/19/2008 2:21:56 AM GMT
Then i fixed it in the LCD object and now works great. Thanks again Mike. I owe you a few...
Post Edited (grasshopper) : 6/19/2008 3:44:26 AM GMT
lcd reads 20.3 instead of 20.30 i want it to look uniform throughout the numbers
Any ideas ?
Again Thanks