A programmer's paradise created by the twist of deliberated fantasies, and actions of a determined imagination.
Follow ME:
If you would like to make an appoinment, contact ME directly via my email address at tuso@programmerspride.com.

Add to Google
Verification Code
Verification Code / Security Code or similar to the CAPTCHA Project. With PHP GD Library, you can create a verification code to verify access o ...

The JavaScript's parseInt() function with decimal numbers

When performing mathematical operations to decimal numbers, don't forget to validate the User input by the use of parseInt().

The syntax is parseInt(string, radix);

The second argument is optional, however in decimal this is very important. Forgetting to set the radix to base 10 won't correctly convert '08' to 8 and '09' to 9.

<script text="text/javascript">

var string = '08';
parseInt(string, 10);