Hi could anyone please help me again. I was trying...
# general
k
Hi could anyone please help me again. I was trying to multiply the following and it does show error. I already tried to add ?numbers at the end of each values/variables but couldn't get it right I already used is_number and both variable shows Yes'
m
Curious as to why you are using freemarker for this. Have you simply tried ${transaction.custbody42} * ${transaction.total} ?. Also, I have had difficulties at times using a percent field in multiplication. Netsuite will sometimes read that as a string.
k
Hi Michael, The reason why I used the freemarker is if I use that ${transaction.custbody42} * ${transaction.total} on the <p> tag, it does print the values of each field and won't be multiplied
m
Ahhh. You would need to string together the <p> tags and the calculation
k
what do you mean 🙂
My screenshot was the result of ${transaction.custbody42} * ${transaction.total}. That's why I was trying to do the calculations first on the freemarker then use the result on p tag of the email template.
m
OK. So when I do this: <td align=“right” colspan=“4">${item.rate +100}</td> I get the amount increased by 100. You should try: ${transaction.custbody42 * ${transaction.total}}
k
Ahh I see, will try that for a sec.
message has been deleted
${transaction.custbody42 * transaction.total} I tried this instead it seems to work but same error I think when I try it on freemarker
message has been deleted
I'll try to convert to number again to see how it goes
Ohh wait one sec, I think it's referring on the other line, I must have remove the old calculation on freemarker
m
This is a ricky one.
k
${transaction.custbody42?number * transaction.total?number}
I'll try to find a solution with that percent type of field
m
I can confirm this works as a calculation <p>${item.rate * item.rate}</p>
So as I mentioned in the beginning, i think your percent value is being evaluated as a string and the two variables can’t be multiplied.
k
Yup yup, do you have solution for that?
I wasn't sure how to convert that to make the calculation work
m
Not unless you change your custom body field to a decimal
k
I wasn't sure for that as they intend to display the percent sign, just like this 20%
transaction.custbody42?replace("%", "", "r")?number
I tried this but the error show about "" which can't be converted to string
number i meant
m
Not sure from here.
k
I'll just try to raise this on NS team
m
Just saw something regarding conversion using TO_NUMBER(SUBSTR(transaction.custbody42,1,2))
k
Hmm, thanks I'll try that later
No success here