Lets say I have:
@crowd = 1 – float or integer
@place = “$hip/$OS/crowd_” – string
I want to end up with:
“$hip/$OS/crowd_1” – the one in the end will vary according to my crowd attribute.
The problem is that I couldn't figure how to mix them in a single string variable in point wrangle sop like:
s@path = @place+@crowd – it doesn't work!
How can I mix them?
I hope it makes sense, thanks in advance.
Mix string and float attributes in point wrangle
5357 5 2- mzigaib
- Member
- 951 posts
- Joined: April 2008
- Offline
- tamte
- Member
- 8597 posts
- Joined: July 2007
- Offline
either by converting integer to string with itoa() function
s@path = s@place + itoa(i@crowd);
or using sprintf() function:
s@path = sprintf(“%s%d”, s@place, i@crowd);
or if crowd number is a float and you want to keep fractional part
s@path = sprintf(“%s%f”, s@place, f@crowd);
s@path = s@place + itoa(i@crowd);
or using sprintf() function:
s@path = sprintf(“%s%d”, s@place, i@crowd);
or if crowd number is a float and you want to keep fractional part
s@path = sprintf(“%s%f”, s@place, f@crowd);
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- mzigaib
- Member
- 951 posts
- Joined: April 2008
- Offline
- mzigaib
- Member
- 951 posts
- Joined: April 2008
- Offline
- tamte
- Member
- 8597 posts
- Joined: July 2007
- Offline
you can define pading in sprintf() directly by putting 0n between % and d
like
s@path = sprintf(“%s%04d”, s@place, i@crowd);
will pad your integer crowd attrib to 4 characters
you can read about it in docs
http://www.sidefx.com/docs/houdini12.5/vex/functions/printf [sidefx.com]
like
s@path = sprintf(“%s%04d”, s@place, i@crowd);
will pad your integer crowd attrib to 4 characters
you can read about it in docs
http://www.sidefx.com/docs/houdini12.5/vex/functions/printf [sidefx.com]
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- mzigaib
- Member
- 951 posts
- Joined: April 2008
- Offline
-
- Quick Links