Endpoints and numbers
- 11 years ago
?number converts a string to a number (see http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_number)
?c converts a number to a computer-readable string (see http://freemarker.org/docs/ref_builtins_number.html#ref_builtin_c)
Numbers can't be displayed, or treated as a string, without first being converted to a string.If you try to include a number in the output of a custom component/endpoint, FreeMarker will automatically try to convert it to a string, using location-based rules.
FreeMarker provides a few different functions to let you convert a number to a string whilst controlling the format. These are all documented on this page:
http://freemarker.org/docs/ref_builtins_number.html
user.id is a number, not a string, so it needs to be converted to a string before you can include it in the output, or use it within another string (like when creating REST API URLs).