How to change input of currency field

Posted by Aede Hoekstra on 11-Dec-2014 03:28

We have the following problem: for currency fields we use the following format: 125,25 (decimal separator is a comma)

But when you enter for example the amount with a dot (like 125.25) the amount is saved as 12525, so thats a big difference. So what we would like is that the amount is stored with a comma, but when entering the input you can use a dot (.) or a comma (,)

Anyone  an idea how to solve this?

Posted by Santosh Patel on 11-Dec-2014 05:13

Goto Object definition > Currency Field Definition > Action (Events) and add following code to onChange or onBlur

if (forumtest.value.indexOf('.') > -1) forumtest.value = forumtest.value.replace('.',',') ;

Replace forumtest with the integration name of your currency field.

I see a bug where the change function is not fired when you directly press Enter to save the field when using inline editing. Will fix this in coming releases. Clicking on the Save or when on an edit page, this works fine.

All Replies

Posted by Santosh Patel on 11-Dec-2014 05:13

Goto Object definition > Currency Field Definition > Action (Events) and add following code to onChange or onBlur

if (forumtest.value.indexOf('.') > -1) forumtest.value = forumtest.value.replace('.',',') ;

Replace forumtest with the integration name of your currency field.

I see a bug where the change function is not fired when you directly press Enter to save the field when using inline editing. Will fix this in coming releases. Clicking on the Save or when on an edit page, this works fine.

Posted by Aede Hoekstra on 11-Dec-2014 05:56

This works! Thanks Santosh!!

This thread is closed