Skip to main content
Level 2
Jan 2, 2024 6:14 PM UTC
Solved

Need to change the format based on variable field.

Hi All,

 

Requirement:  Need to populate the dynamic/variable information in X.XX % design in the email creative. On the off chance that, variable field have X.X% then, at that point, need to add '0' and make design X.XX % in any case keep the first arrangement X.XX%.

 

for e.g., if data is coming from source, have 4.5 then need to make 4.50 %.  in case, it is coming 4.50 then need to keep as it is 4.50%.  

Field/ column is string.  

 

regarding 0%, tried to apply direct concat but it is also not working as well. 

 

{%=concat(xyz field,"0%") %}

xyz column- coming from custom actions

 

Thanks. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Mohan_Dugganab
Mohan_DugganabAccepted solution
Adobe Employee
Jan 3, 2024 4:29 AM UTC

@st_questions 

You can use the following helper function

{%= toPrecision(4.5, 2) %}%

6 replies

KellieGardner
Community Advisor
Community Advisor
Jan 2, 2024 8:01 PM UTC

@st_questions - is this question related to Workfront or another Adobe Product? I'm not sure I understand where you are looking to do this Workfront so it's leading me to think it's a different product.

 

Thanks for clarifying.

 

 

Translate
Level 2
Jan 2, 2024 8:19 PM UTC

it is related to AJO. Can you move this or let me know if I need to raise in AJo community? 

Translate
KellieGardner
Community Advisor
Community Advisor
Jan 2, 2024 9:11 PM UTC

I was able to move it. Thanks!

Translate
Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe Employee
Jan 3, 2024 4:29 AM UTC

@st_questions 

You can use the following helper function

{%= toPrecision(4.5, 2) %}%

Translate
Level 2
Jan 3, 2024 2:08 PM UTC

Thanks, but this function work if column type is number. I am working on string field. 

Translate