ToStr() code example
Example 1: javascript convert number to string
var myNumber=120;
var myString = myNumber.toString();
Example 2: to_string c++
#include <iostream>
#include <string>
int main ()
{
std::string pi = "pi is " + std::to_string(3.1415926);
std::string perfect = std::to_string(1+2+4+7+14) + " is a perfect number";
std::cout << pi << '\n';
std::cout << perfect << '\n';
return 0;
}
Example 3: javascript decimal to string
<script language="JavaScript" type="text/javascript">
var a = 3.3445;
var c = a.toString();
alert(c);
</script>