Explore the community Forums Lectora Lectora Questions & Answers Formatting in-line variables Reply To: Formatting in-line variables

#431346 Score: 0
Profile photo of Lydia B
Lydia B
curious george
wise owl
friend finder


I really appreciate you taking the time to respond.

I have search and tried, but I am afraid that my lack of knowledge is preventing me from getting it to work.

I followed the instructions on the post mentioned by Carl and got the field to be right justified and used your code to add the commas as thousand separators, but the code changed the way the entry field looks. It took out all my other changes to the field and upon input it seems as it took the field back to default.

Is it possible to alter your code to target specific field?

Your code:


The above code justifies all the fields. I need to target the specific one.

You also used this code to add commas as thousand separators:

var theentry = document.getElementById(“%HTMLNAME%id”).value.replace(/,/g, ”);
document.getElementById(“%HTMLNAME%id”).value = parseFloat(theentry).toLocaleString(‘en’);

Thank you again for that code! It works amazing and it is easy to use. Is there a way to add decimal places? I tried the currency, but it adds a dollar sign, which I do not want. I tried to add the minimum and maximumFractionDigits, but it disallowed number larger than one integer.

If you are able to, I would appreciate any help you may offer. Thank you for responding either way Math.