We are using ProcessFlow with an 8.0 environment, meaning all of our emails are plain text. To assist with formatting so we can make the emails look a little better, I'm trying to get a "Double" variable formatted to display 2 decimal places. This is easy to do using the round(var,2) function, but if the variable is an integer it won't display the .00. So we'll see "16" instead of "16.00", but if the variable is 16.49 that will display correctly.
Has anyone used a javascript function to force a double variable to display 2 decimal places?
Thanks
toFixed is working to convert longer decimals into 2 decimals, but it still isn't showing trailing zeroes.
Double WHOLE = 16
Double DECIMAL = 16.4801
WHOLE.toFixed(2) returns "16", and DECIMAL.toFixed(2) returns 16.48. I was thinking this was not a problem with the toFixed method, but with the way ProcessFlow carries and displays numeric objects.
Thanks Shane.
I was hoping to do this without all the extra branch nodes, but I ended up using them anyway. The node checks if it's a whole number using PRICE == round(PRICE, 0), and if it is a whole number it converts the number to a string (as you suggested) and adds .00 to the end.