Is there a way to remove the decimals from as currency field?
Question
Question
Replies
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:
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).
Thank you Matthew.
I will look into this as a possible solution.