I have a program that returns a number (6, at the moment) of numerical results, converts them to strings, then concatenates them for sending over ZMQ.
Example outputs are:
Results: 7.85, -5.75, 16.0, 0.0, 0.84375, 0.828125
7.85-5.7516.00.00.843750.828125
Results: 5.25, -10.72, 8.5, 0.0, 0.752, 0.8265
5.25-10.728.50.00.7520.8265
After receiving this string through ZMQ I then need to split it apart again.
To make this work, I think specifying the length of the strings is the simplest way to go, so I always know I'll have x characters for each answer, and I can then use stringsplit at the end to get my individual results.
Problem is I can't find out how to do that. I know how to specify the number of decimal places, but when I have single/double digit whole numbers, sometimes with - signs, I get a bit stuck...
thanks
','.join()and then split on commas at the other end, usingstr.split(',')