Monday, May 08, 2006

Converting Double to String with J#

So, you made an awesome function that does cool things. Only the return type is a double and you have to display it as a string. No problem, you'll just have to convert it using this little snippet:
String my_String_for_Display = new String();
my_String_for_Display = Double.toString(my_Function());
This should would for C# as well, with minor modifications, but check the MSDN pages. This will also work for a double value instead of a function call, function with parameters, etc.

No comments: