Friday, December 15, 2006
Yay! First post!(WCD)
Some things to take note of for WCD assignment:
To make an input box which cannot be changed, use the following:
(input value="anything you like" readonly) Note: use pointy brackets
Example:
To truncate a number, use Math.round
To truncate to 2 decimals, use Math.round(value*100)/100
For example, if value is 10.567
value*100=1056.7
Math.round will make a decimal into nearest whole number.
Thus Math.round(1056.7) will make 1057
Math.round(value*100)/100=1057/100=10.57
Example:
The codes can be seen near top in the source codes. Please TRY to copy with understanding.:p
PS: Dun tell lecturers that it is posted here.(Or later everyone lesser marks =X)
To make an input box which cannot be changed, use the following:
(input value="anything you like" readonly) Note: use pointy brackets
Example:
To truncate a number, use Math.round
To truncate to 2 decimals, use Math.round(value*100)/100
For example, if value is 10.567
value*100=1056.7
Math.round will make a decimal into nearest whole number.
Thus Math.round(1056.7) will make 1057
Math.round(value*100)/100=1057/100=10.57
Example:
The codes can be seen near top in the source codes. Please TRY to copy with understanding.:p
PS: Dun tell lecturers that it is posted here.(Or later everyone lesser marks =X)
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home