I wonder why there is no triple to string function included:
string trip2str(triple T) { return "(" + string(T.x) + "," + string(T.y) + "," + string(T.z) + ")"; }
I use this all the time and am a little surprised that it is not predefined. Did I miss something in the documentation? (if so, my bad :-( ).
Use a cast here: in interactive mode
~~~~~~~~~~~~~~~~~ import three; (string) X; ~~~~~~~~~~~~~
returns (1,0,0)
Log in to post a comment.
I wonder why there is no triple to string function included:
string trip2str(triple T) {
return "(" + string(T.x) + "," + string(T.y) + "," + string(T.z) + ")";
}
I use this all the time and am a little surprised that it is not
predefined. Did I miss something in the documentation? (if so,
my bad :-( ).
Use a cast here: in interactive mode
~~~~~~~~~~~~~~~~~
import three;
(string) X;
~~~~~~~~~~~~~
returns (1,0,0)