Houdini - VEX - Convert Float to String with 2 decimals

Here an example for detail wrangle node.
The decimal padding is done with sprintf() function.
float a = detail(0, chs("attribute"), 0); 
string trunc = itoa(int(trunc(a)));
int ifrac = int(rint(frac(a)*100));
string frac = "00";
if (ifrac == 100) {
    trunc = itoa(int(trunc(a)) +1); 
}
else {
    frac = sprintf("%02d", ifrac);;
}
s@string_attribute = trunc + "." + frac;