If you have a string variable representing a number, you can convert the value into a real variable by using the str2num function.
static void Datatypes_str2num(Args _args)
{
str mileage;
real mileageNum;
;
mileage = "388272.23";
mileageNum = str2num(mileage);
print strfmt("The car has run %1 miles", mileageNum);
pause;
}
static void Datatypes_str2num(Args _args)
{
str mileage;
real mileageNum;
;
mileage = "388272.23";
mileageNum = str2num(mileage);
print strfmt("The car has run %1 miles", mileageNum);
pause;
}
No comments:
Post a Comment