Description: A useful utility that rounds any number to the specified decimal place. This is needed because JavaScript doesn't have any built-in methods for the task. The function takes two parameters- a number (has to be a number datatype), and the number of places to round it to.
Example: n/a
Directions: Add this script to your page:
To round numbers using it, simply invoke the function:
roundit(78.4333, 2)
where the first parameter (78.4333) is the number to round, and the second (2), the number of decimals to round it to. For example, the following alerts this processed number:
<script>
//alerts 78.43
alert(roundit(78.4333,2))
</script>
Description: Use this practical script to easily convert between the 7 most popular length units- centimeters, meters, kilometers, miles, inches, feet and yards. Simply enter a number, and let the script display the desired equivalents. Cool!
Example:
1 select a length unit from the "From" dropdown list and one from the "To" dropdown list.
2 Enter a numeric value, and click "To" button.
Directions:
Step 1: Insert the below script into the <HEAD> section of your page:
Step 2: Insert the below HTML block in the <BODY> section of your page: