Currency expression field returns a lot of digits after the

Posted by Rollbase User on 10-Dec-2012 14:15

Hi all, I have configured the following expression field:  As configured, I want to use the currency field with 2 decimals with the comma as the decimal seperator. In the view explorer, everything looks fine. See the screenshot below:  But when I want to retrieve the value with an API as follows: rbv_api.selectValue("select sum(test) from myobject where id = '61613186'"); ....then i get the following result: -437178.22000000 As you can see, the decimal seperator has been changed and I get a lot of digits behind the dot. How can I get the right decimal seperator and only 2 digits after the decima

All Replies

Posted by Admin on 10-Dec-2012 15:34

Try selectNumber API instead of selectValue - this may strip zeros at the end.



Please note that currency format only applies to UI presentation. Internal presentation in formulas does not include rounding or formatting.

Posted by Admin on 14-Dec-2012 14:25

Hi Pavel,

I need to get the comma as seperator (European common format), but cannot use the Mysql REPLACE function with the rbv_api.selectNumber API(within an excel template). This function always returns a 0. When using the selectvalue API, i need to add a lot of extra functions to strip the zeors and to round to a number.



Could you please check the SelectNumber API and make the decimal seperator configurable?

Posted by Admin on 14-Dec-2012 23:29

From JavaScript prospective dot is the only legal decimal separator. For presentation you can choose comma. So I do not understand why do you need to modify selectNumber() output.

Posted by Admin on 15-Dec-2012 02:39

Hi pavel,

When i load the data into excel the amounts are messud up. We dont use the thousand seperator, which is a comma and the decimal seperator which is a dot. I dont want to use macro's to substitute the dot into a comma within excel, which is the right seperator. Right now, excel treats the values as a string, thats the reason.

Posted by Admin on 15-Dec-2012 11:00

I can add server-side API to format numbers similar to API to format dates (which we already have)

Posted by Admin on 15-Dec-2012 11:18

Hi Pavel,

That would be very much appreciated. Currently im using complex ROUND functions to round the digits after the decimal seperator. At the end, im also replacing the dot as a decimal seperator with a comma, because of our local Regional settings

Posted by Admin on 17-Dec-2012 15:21

Hi Pavel,

Do you know when you can add this feature?

Posted by Admin on 17-Dec-2012 15:52

In 3.9.0 release due on Dec 22nd

This thread is closed