valstr()
Description
Convert a number to text (string).
Syntax
valstr(dest[], value, pack);
Parameters
Variable | Input |
|---|---|
| The string to store the text representation of the number in. |
| The number to put in the string |
| If true, |
Returns
The number of characters stored in dest, excluding the terminating “\0” character.
Function call example
Example of converting value to string
new Destination_array[6];
new Number = 45;
new data;
main(){
data = valstr(Destination_array,Number,false);// this will convert number 45 to ASCII 45 and stores in destination_array, and return length of string to data
while(1){
Delay(1000);
}
}
Notes and Warnings
Parameter dest should be of sufficient size to hold the converted number. The function does not check this.