[Premium]{class="badge positive" title="See what's included in Target Premium."}
Design FAQ design-faq
On this page: Find answers to frequently asked questions about Adobe Target Recommendations designs.
By default, numeric values (such as entity.value) returned in designs do not display any trailing zeroes after the decimal point. For example, if an item costs $35.00, entity.value is equal to 35 and only 35 is displayed on the page, not $35.00.
Two options are available to address this issue:
-
Velocity scripting or JavaScript can apply formatting to the returned value.
-
The price of the item can be passed into two separate entity attributes. The first,
entity.value, can be used for numeric comparisons (such as price comparison rules). The second should be a custom attribute, such asentity.displayValue, that stores the value of the entity as a string to allow for proper rendering.For example,
"entity.value" : 35.00, "entity.displayValue" : "$35.00"
$key parameters capture most of the information of the key product for display within the design. For example, to display the thumbnail of the key product, use $key.thumbnailURL.\u00A0 as the value, for example entity.message=\u00A0. Using that value as the default when no value is present, instead of a null, can also be considered.\${...}. For example, if the profile script is named user.basket, refer to it as \${user.basket} in the design. The backslash implies that the profile script is not rendered by Velocity, so no operations can be performed on the profile script in a Velocity template. The value is printed directly on the page.