[ANSWERED] number to text actor
-
This is exactly the kind of thing the Text Formatter can do.
1) Add a Text Formatter
2) Double click the actor
3) Replace "data" with P1 and click OK
4) Now number inputs to 'param 1' will be converted to textIf you needed three numbers separated by commas to, for instance, send to an Arduino or something
1) Add a Text Formatter
2) Set the 'params' input to 3
3) Double click the actor
4) Enter the following textP1 "," P2 "," P3
5) Click OK
6) Now the three numeric inputs will be converted to a text string like "1,2,3"There are many options to control the formatting of the numbers. Click the "Help" button when the actor's dialog box is open to learn more.
Best Wishes,
Mark -
thank you very much, also for fixing the control panel update so fast.
the westfernsehen team, leipzig.
-
hello, how is it possible to say the formatter to give only two places after the decimal point to the output?
thx.
-
if you click on the help button in the Text formatter actor you will find this:
Px:n.m Output the number, with a maximum of n digits to the left of the decimal point and m digits to the right. If the input parameter is text, ignore n.m and just output the text.
Px:Zn.m Same as above, but add leading zeros to ensure a total of n digits appear to the left of the decimal point.Best regards,
Jean-François
-
@jfg I know this is the right choice, but, thinking of students, people who aren't good in programming, wouldn'it be easier if we had (and we had it in the past) a "number to character" actor ? We would still use the text formatter for more complex operations like creating strings and prepend or append stuff, but I wonder if it wouldn't be easier and faster for this audience. Plus, more symmetrical, because we have a "character to number" actor. I would expect a "number to character" too. Much more intuitive for the beginners. It took a while for me too to understand the power of the text formatter...
-
I agree @armando, I often I instinctively look for that actor, thinking it has to be here somewhere because the other direction exists. Then I remember and grab a text formatter.
-
@fubbi same here
-
@armando said:
Plus, more symmetrical, because we have a "character to number" actor.
Plus, more symmetrical, because we have a "character to number" actor.
The "character to number" converts the first character of the input text to its decimal equivalent, e.g. "Character" > C=67 or 225 > 50 the value for 2.
To convert a value to a text you can also use this actor from Juriaan on the add-ons page:
LANGUAGE BASED – NUMBER TO TEXT FORMATTER
it give you also the possibility to set the numbers of decimals.
You can also use a macro or a user actor with only an input and an output for which you change the properties.
Best regards,
Jean-François
-
Brilliant and elegant solution, JF (as always). Sorry I didn't see the "Value to text actor too who does the job perfecty. Forget I said something
-
-
@woland Creative as always. Thanks