Forum Discussion
Hi Adam,
The built in is working just fine. I'm now facing a REST API call issue.
I'm trying to retrieve certain Community's blog list with
<#assign global_blogsCount = rest('boards/style/blog/nested/count').value/>
However, when I try to use this value for a very simple calculation such as
<#assign leftColumnEnd = (global_blogsCount/2) />
I get the following error.
Expression global_blogsCount is not numerical
Could you please advice?
Gracias,
Luis
As far as freemarker is concerned, the value you're getting back is a string. So if you want to use it as a number, you need to convert it. There's a "number" built-in that can be used with strings. For example:
<#assign global_blogsCount = rest('boards/style/blog/nested/count').value?number />
In case you're curious, you can find a full listing of the available freemarker built-ins here:
http://freemarker.sourceforge.net/docs/ref_builtins.html
I hope this helps!
-Adam
Related Content
- 5 months ago
- 3 years ago
- 2 years ago
- 2 years ago
- 2 years ago