c++ double to string

#include <iostream>
#include <sstream>

int main() {
    double number = 123.456;

    // Step 1: Create a stringstream object
    std::stringstream ss;

    // Step 2: Insert the double value into the stringstream
    ss << number;

    // Step 3: Convert the stringstream to a string
    std::string result = ss.str();

    // Step 4: Output the converted string
    std::cout << "Converted string: " << result << std::endl;

    return 0;
}