Skip to content

Instantly share code, notes, and snippets.

@morphingdesign
Created February 9, 2021 05:29
Show Gist options
  • Save morphingdesign/0cad5bf508575bbe638c8cf6e0124b40 to your computer and use it in GitHub Desktop.
Save morphingdesign/0cad5bf508575bbe638c8cf6e0124b40 to your computer and use it in GitHub Desktop.
Data type conversion operations specified for use in Houdini Vex
//Convert integer to string
s@string_attribute = itoa(i@int_attribute);
//Convert string to integer
i@int_attribute = atoi(s@string_attribute);
//Convert string to float
f@float_attribute = atof(s@string_attribute);
@alt-st
Copy link

alt-st commented Apr 10, 2023

How convert float to string? ("ftoa" is expression but not vex)

@MysteryPancake
Copy link

How convert float to string? ("ftoa" is expression but not vex)

You can use sprintf()

string float = sprintf("%f", 1.234);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment