Here is my first attempt. unfortunately, I don't even know how to
initialize this monstrosity. I am going to try and get some test data to
compare against and verify.
I realize this is a Windows type and I should (and am) asking on the
Windows forums, but just looking for the native C++ tips here, since
there might be a better solution than using stringstreams and string
operators.
//------------------------------------------------------------------------------
std::string DecimalToString(const DECIMAL & decimal)
{
std::ostringstream converter;
converter << decimal.Hi32;
converter << decimal.Lo64;
if( !decimal.sign )
{
converter.str().insert(converter.str().begin(), '+');
}
else
{
converter.str().insert(converter.str().begin(), '-');
}
converter.str().insert(converter.str().back() - (decimal.scale +
1), '.');
return converter.str();
}