You are viewing limited content. For full access, please sign in.

Question

Question

remove currency decimals

asked on March 19, 2020

Is there a way to remove the decimals from as currency field?

0 0

Replies

replied on March 19, 2020

I don't believe there is, or at least I haven't seen one - but this small bit of tweaking can make a regular number field (which can be set to zero decimal places) include the currency symbol.

On your number field, give it the CSS Class Name of: myCurrencyField

Then add this little bit of Javascript to the form:

$(document).ready(function () {
  
  $('.myCurrencyField input').each(function() { 
    $(this).before('<span class="margin-end">$</span>');
  });
  
});

This is the end result:

1 0
replied on March 19, 2020

So that you know, the Javascript is running as soon as the form loads - it finds every single input field (any field other than drop-downs and multi-line) that has the myCurrencyField class and adds the $ label before it.  It should work regardless of how many fields with that class that you have on the form (but won't work on rows added to tables or collections, since those fields don't exist at the time the form is loaded).

0 0
replied on March 21, 2020

Thank you Matthew. 

I will look into this as a possible solution.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.