decimal number separator delimiter comma or point
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2013 07:39 AM
Hello!
I've an Alfresco Community Network - v2.9.0 (B 683) installation running on http://localhost:8089/alfresco/
I've customized web scripts defined at Company Home > Data Dictionary‬ > Web Scripts Extensions > com > companyname > webscripts > llistats > {*.xml}{*.ftl}
At someplace in the script I've a line defining this sentence
but then, corresponding result of calling directly the script is (for example)
Why I'm getting a comma as decimal number separator? How can I change it?
Thanks in advance!
I've an Alfresco Community Network - v2.9.0 (B 683) installation running on http://localhost:8089/alfresco/
I've customized web scripts defined at Company Home > Data Dictionary‬ > Web Scripts Extensions > com > companyname > webscripts > llistats > {*.xml}{*.ftl}
At someplace in the script I've a line defining this sentence
"filesize":<#if doc.isDocument>${(doc.size/1024)?string('0.##')}<#else>""</#if>,‍
but then, corresponding result of calling directly the script is (for example)
"filesize":0,01,‍
Why I'm getting a comma as decimal number separator? How can I change it?
Thanks in advance!
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2013 03:48 AM
maybe I forgot to say that I'm using json format
I mean, I have
/Company Home/Data Dictionary‬/Web Scripts Extensions/org/examples/webscripts/test.get.desc.xml
and
/Company Home/Data Dictionary‬/Web Scripts Extensions/org/examples/webscripts/test.get.json.ftl
And I call it trough
And I get the result
I mean, I have
/Company Home/Data Dictionary‬/Web Scripts Extensions/org/examples/webscripts/test.get.desc.xml
<webscript> <shortname>Webscript test</shortname> <description>Webscript test description</description> <url>/test</url> <authentication>guest</authentication> <transaction>required</transaction></webscript>‍‍‍‍‍‍‍
and
/Company Home/Data Dictionary‬/Web Scripts Extensions/org/examples/webscripts/test.get.json.ftl
hello, this is a test of the decimal separator/delimiter in alfresconow the number${(11.1)?string('0.##')}‍‍‍
And I call it trough
http://localhost:8089/alfresco/service/test?format=json‍
And I get the result
hello, this is a test of the decimal separator/delimiter in alfresconow the number11,1‍‍‍

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2013 02:59 PM
I believe that this depends on your Locale setting.Freemarker can format numbers in different ways, and to me it helped to read <a href="http://freemarker.sourceforge.net/docs/ref_builtins_number.html">Freemarker builtins for numers</a>. Since then, I had a better understanding of Freemarker. At least I know what could be the problem 
So I believe you should change the locale on your installation to get the default separator to be a dot. Hope that'll at least get you on the right direction.

So I believe you should change the locale on your installation to get the default separator to be a dot. Hope that'll at least get you on the right direction.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2013 08:13 AM
Thanks zladuric
I can put the line
at the begining of every script (*.FTL) to force this locale and get the so much desired decimal delimiter/separator
But I still have the doubt on where is this setting sepecified by default
I can put the line
<#setting locale="en_US">‍
at the begining of every script (*.FTL) to force this locale and get the so much desired decimal delimiter/separator
But I still have the doubt on where is this setting sepecified by default
