bloomreach / bloomreach/docs-feedback
Error occurs if product price is >= 1000
- Dominant language
- No language data
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
https://xmdocumentation.bloomreach.com/trails/developer-trail/develop-new-features/products-part-2-products-overview.html
When creating products as part of the tutorial, the user will enter a price for each product. This price is then displayed in the Freemarker template using `<@fmt.formatNumber value="${item.price}" type="currency" />`.
During template render, the decimal value appears to be converted to a String before being passed to the `formatNumber` function, and if the value is greater than or equal to 1000, the value gets commas added to it (eg. "1,000"). This causes the `formatNumber` function to fail with a `java.lang.NumberFormatException`, as the value cannot be parsed into `java.lang.Number`.
As a workaround, I was able to display larger numbers using the following:
`<@fmt.formatNumber value="${item.price?string.computer}" type="currency" />`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.