I'm using a number field to calculate an employee's retirement plan contribution as a percent of annual base salary. The formula I'm using in the field's Advanced Tab is working fine. I would like the field to show a % symbol. Any help would be appreciated.
Question
Question
Replies
You could use the Concatenate function?
Something like this...
The Number field has the following calculation based on the value from the Number Hidden field...
=CONCATENATE(Number_Hidden," ","%")
You can remove the space too - =CONCATENATE(Number_Hidden,"%")
Let me know if you need anything further?
Jonathan
Hi Jonathan,
Yes, this worked perfectly. Thank you so much! I was really over thinking it and trying to complicate things.
Hi Jonathan,
Is there a way to make a blank field show as a percentage before a number is input. I have included a field where an employee can enter a number (percentage) to calculate future retirement plan contributions. This is truly aesthetic but would be nice to have.
Hi Wendy,
This was a little tricky, and I did have some help..
$(document).ready(function () { $('.JoinMe').on('focusout',function(){ var xyz = $('.JoinMe input').val(); xyz += '%' $('.JoinMe input').val(xyz); }); }); $(document).ready(function () { $('.JoinMe').on('focusin',function(){ var xyz = $('.JoinMe input').val(); xyz = xyz.replace ('%', ''); $('.JoinMe input').val(xyz); }); });
JoinMe was the class that I set for the Single Line field.
The first part adds the '%' when they go away from that field (focusout).
The second part removes the '%' when they select the field. This is to allow for them to change the number without adding a percent each time.
Jonathan
Hi Jonathan,
I tried your script in a Single Line field and I when I enter a number into the field it only enters a %. The number doesn't stick.
I then used your script in a number field and the number sticks but it produces an "Invalid Input" error message the first time I enter a number. If I enter the same number again the error goes away. The % does work. The only parameters I have on the field are range 1-100 and 2 decimal places. Any ideas?