integer to string in DAT section
Shawna
Posts: 508
I would like to take a long variable and convert it into a string.
For instance if I have a value of 989, I would like to store it as a string in the dat section like this.
str byte " 98.9"
Is there an easy way to do this?
I can break the value down into whole numbers and decimals like this
Is there an easy way to do this?
The range is going to be +/- 200.0, so no matter what the value is I need to have 6 characters store in the dat section.
Thanks
Shawn
For instance if I have a value of 989, I would like to store it as a string in the dat section like this.
str byte " 98.9"
Is there an easy way to do this?
I can break the value down into whole numbers and decimals like this
temp := 989 tempDec := temp // 10 tempWhole := temp / 10
Is there an easy way to do this?
The range is going to be +/- 200.0, so no matter what the value is I need to have 6 characters store in the dat section.
Thanks
Shawn
Comments
-Phil
Temp would have to be a long but converting it to a few bytes can be done later
as long as the math is done correctly why not just do like that?
1120259277 (Decimal)
42C5CCCD (Hexadecimal)
01000010110001011100110011001101 (Binary)