JavaScript Numbers FAQ
You are here: irt.org | FAQ | JavaScript | Numbers
- FAQ 6 How do you display the .00, or in the case of 50 cents display .50 instead of .5?
- FAQ 7 How do you round a number to a X decimal places?
- FAQ 8 Is it possible to output a number e.g. 1234567 as 1,234,567?
- FAQ 39 Is there a simple way to test if a variable is a number, e.g. test for entries like "1234a6789"?
- FAQ 146 How can I convert a decimal number into a hexidecimal number?
- FAQ 183 How can I format a number, e.g. 2, as 02 and 00002?
- FAQ 201 What does the floor() function do?
- FAQ 258 When attempting to detect for Internet Explorer 3 using parseFloat(navigator.appVersion) it always returns 2, why, and what can I do about it?
- FAQ 269 How do you convert an integer to a string?
- FAQ 289 How can I calculate subtotals, tax and totals on prices of products without producing rounding errors?
- FAQ 332 Is there any way to specify that you want only numbers allowed in a text box?
- FAQ 354 How do I format a form field 10 digit only numeric string to conform to the specific phone number format 123-123-1234?
- FAQ 363 Is there an easy way to change a decimal number string (i.e. .5, .25) into a percentage (i.e. 50%, 25%)?
- FAQ 535 Is there a way I could drop the decimal point in a fraction and make it a whole number?
- FAQ 618 How do I validate that a number entered in a text field is a hexidecimal number?
- FAQ 629 How can I round a decimal number to a whole number (ie: 1.52=2)?
- FAQ 723 How can I reformat a text field to display a money value, for example 100,000.00?
- FAQ 852 How can I validate an IP address that a user tupes into a field to ensure that it has four valid octets?
- FAQ 960 How can I create a form with monetary values that when selected from a drop down box the correct values are added together to give a final figure?
- FAQ 1008 Is there an alternative for isNan() which is only supported in javascript1.1?
- FAQ 1017 How can I convert "1234.56" to "One thousand two hundred thirty-four and fifty-six" cents?
- FAQ 1031 What is the range of Integer data types in JavaScript?
- FAQ 1287 How can I mask certain bits of an integer?
- FAQ 1389 How can I detect whether a number is odd or even?
- FAQ 1431 How can I create a random set of numbers/letters/characters into a form text box for use as a random password?
- FAQ 1439 How can I show all the lower case letter combinations from a to zzzz?
- FAQ 1503 How do I round a number which is separated by commas to 2 decimal places, e.g. 10,987.9876 to 10987.98?
- FAQ 1584 How can I find the remainder or the quotient in a division?
- FAQ 1604 How can I ask a user for input using a prompt and validate whether or not it is a number?
- FAQ 1684 How can I round to two decimal places, but without losing any zeros in the answer?
- FAQ 1721 How can I round up a number to the nearest 0.5?
- FAQ 1802 How to make sure a user enters percentage correctly like 88.66 and not 8888 or 888.6..?
©2018 Martin Webb