Change currency format

Posted by IramK on 02-Feb-2015 04:06

Hello,

I am trying to change the currency format onchange of the currency field and onsubmit of the form. Currently my currency field format is: £###,###,###.## and I would like to remove the decimal point on change of field as well as when the user tries to submit the form.

For eg: 4545 entered on the field should save it as: £4,545.

All Replies

Posted by Manooj Murali on 02-Feb-2015 04:14

May a script to return a substring of the the field value until the index of dot, would work?

This post had a similar requirement : community.progress.com/.../53437.aspx

Posted by IramK on 02-Feb-2015 04:55

I tried that but On clicking the save, it retains the currency format. How do I change it on Save?

Posted by Godfrey Sorita on 02-Feb-2015 08:59

Hi Iram,

There is an onblur function which is automatically added on currency fields. Unfortunately you cannot remove it directly from the event component of the field. You can however remove it by adding the code below on your script component:

$(function(){
  $("#Amount").removeAttr("onblur");
  $("#Amount").blur(function() {
    //code to replace your onblur code here
  });
});  

While this code removes the client-side formatting, the format will still be the same upon saving the value. I believe a server-side code is formatting the value.

Regards,

Godfrey

Posted by IramK on 02-Feb-2015 09:27

[mention:9c7be15f444c42e4809af5b84a23adff:e9ed411860ed4f2ba0265705b8793d05] : I can get the onblur/ onchange to work but the format on saving is still not getting saved properly. It retains the format that it has from the field definition. I tried a trigger to update that field value but it doesn't work. Any suggestions?

Posted by Godfrey Sorita on 02-Feb-2015 09:42
I don't know a way to bypass the currency formatting but you can use a string formula field to display the format you want to display on your UI.
Posted by Santosh Patel on 02-Feb-2015 13:35

The value stored in database is always without formatting. Because the field has a format set, any place the value is processed and rendered the formatting specified on the field definition applies. For custom formats, use the way suggested by Godfrey

Posted by IramK on 03-Feb-2015 04:51

We are using Private Cloud. Is there a setting we could change to add it to the list of currency format?

Posted by Manooj Murali on 03-Feb-2015 05:05

I dont think there is a way to put in a custom currency format at the moment. (Its pretty much a hard coded list)

In 3.2 we are working on enhancing the list of currency formats Rollbase provides.

Posted by IramK on 03-Feb-2015 05:10

Could you possibly let me know as to when is 3.2 due to release please?

Posted by Godfrey Sorita on 03-Feb-2015 06:13
Rollbase 3.2 is tentatively scheduled to be released at the end of February.
Posted by IramK on 03-Feb-2015 06:30

Could you please confirm whether you'd be providing this format in that list: £###,###,### ? (without the decimal).

Posted by Manooj Murali on 03-Feb-2015 07:06

We are currently consolidating a list of formats we want to put in. We will take this as one of the inputs.

-Thanks

Manooj

This thread is closed