Round numbers in JavaScript with precision

JavaScript has an inbuilt Math object with several useful methods that you can use to perform common mathematical operations on numbers.
One of the most common tasks encountered when dealing with numbers in application development is rounding them off.
For this the Math.round() method comes in handy and can be used like this:

var someNumber=5.568942354894534;
var x=Math.round(someNumber); 

After the line is executed, x now holds the value 6.
But what if that is not we wanted? What if I wanted to round off the number to 2 places of decimals?
Read more…


Lenovo Essentials G580 laptop quick review and issues

I was in search of a budget laptop in the Rs 35,000-40,000 ($660-$760) price range and after quick a bit of market research, I settled with a Lenovo Essentials G580 laptop for Rs 34,000 ($650) with the following specifications:

  • Intel® Core i5 3rd generation processor (3210M) with dual cores clocked at 2.50 GHz
  • 4GB of DDR3 RAM
  • 500GB HDD
  • Integrated Intel HD graphics 4000
  • 0.3 megapixels webcam
  • 15.6″ Brightview HD LED Widescreen display with LED back-lit
  • AccuType Keyboard with individual rounded keys
  • 2 x USB 3.0, 1 x USB 2.0 ports

Read more…

Scientific Math functions web app

Scientific math functions web app

This app is written entirely in javascript and the user interface is inspired by the Microsoft Metro design language to some extent.
Here are the list of features included in it:

  • Trigonometric functions
  • Inverse trigonometric functions
  • Logarithmic functions
  • Exponential functions
  • Square root and cube root
  • Factorial calculation
  • Degree to radians and radians to degree conversion
  • Decimal to binary and binary to decimal conversion
  • Check if number is prime
  • Convert a real number to fraction representation (buggy)

Visit scientific math functions web app

Currency Converter

Universal currency conversion tool

Check out our currency conversion tool just launched here:

  • Hourly updated near-accurate exchange rates
  • Around 160 currencies
  • Commision calculator
  • Light-weight and fast
  • Has a handy list of currency codes and names

This javascript tool uses the excellent free currency rates api from
A tutorial on how to easily create one such tool yourself is in the pipelines…so watch this space :)
URI : Disclaimer:
Exchange rates provided for informational purposes only, with no guarantee whatsoever of accuracy, validity, availability, or fitness for any purpose; use at your own risk. Other than that, have fun! Usage subject to acceptance of terms:”

Code for HTML drop down menu of all timezones

Here is a list of all timezones in the form of a HTML drop down that you can use in your projects:

        <select name="timezone">
		<option value="-12" >(GMT -12:00) Eniwetok, Kwajalein</option>
                <option value="-11" >(GMT -11:00) Midway Island, Samoa</option>
                <option value="-10" >(GMT -10:00) Hawaii</option>
                <option value="-9"  >(GMT -9:00) Alaska</option>
                <option value="-8"  >(GMT -8:00) Pacific Time (US &amp; Canada)</option>
                <option value="-7"  >(GMT -7:00) Mountain Time (US &amp; Canada)</option>
                <option value="-6"  >(GMT -6:00) Central Time (US &amp; Canada), Mexico City</option>
                <option value="-5"  >(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima</option>
                <option value="-4.5">(GMT -4:30) Caracas</option>
                <option value="-4"  >(GMT -4:00) Atlantic Time (Canada), La Paz, Santiago</option>
                <option value="-3.5">(GMT -3:30) Newfoundland</option>
                <option value="-3"  >(GMT -3:00) Brazil, Buenos Aires, Georgetown</option>
                <option value="-2"  >(GMT -2:00) Mid-Atlantic</option>
                <option value="-1"  >(GMT -1:00 hour) Azores, Cape Verde Islands</option>
                <option value="0"  selected="selected">(GMT) Western Europe Time, London, Lisbon, Casablanca, Greenwich</option>
                <option value="1"   >(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris</option>
                <option value="2"   >(GMT +2:00) Kaliningrad, South Africa, Cairo</option>
                <option value="3"   >(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option>
                <option value="3.5" >(GMT +3:30) Tehran</option>
                <option value="4"   >(GMT +4:00) Abu Dhabi, Muscat, Yerevan, Baku, Tbilisi</option>
                <option value="4.5" >(GMT +4:30) Kabul</option>
                <option value="5"   >(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option>
                <option value="5.5" >(GMT +5:30) Mumbai, Kolkata, Chennai, New Delhi</option>
                <option value="5.75">(GMT +5:45) Kathmandu</option>
                <option value="6"   >(GMT +6:00) Almaty, Dhaka, Colombo</option>
                <option value="6.5" >(GMT +6:30) Yangon, Cocos Islands</option>
                <option value="7"   >(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
                <option value="8"   >(GMT +8:00) Beijing, Perth, Singapore, Hong Kong</option>
                <option value="9"   >(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option>
                <option value="9.5" >(GMT +9:30) Adelaide, Darwin</option>
                <option value="10"  >(GMT +10:00) Eastern Australia, Guam, Vladivostok</option>
                <option value="11"  >(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option>
                <option value="12"  >(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option>

HTML drop down code generator

Hand-coding a HTML drop down menu using the <select> and <option> tag with many options is a task that many developers/designers find tiring and frustrating.

That is why I’ve created this simple tool that generates the code for HTML drop down menu with as many options as you like!

The URL is :

You simply have to enter the name of variable, (for the ‘name’ attribute of select tag) and start adding options in an easy and straight-forward fashion.

Once you are done with specifying option values, hit the Get code button and it will generate all the necessary HTML code along with a preview.

You can add as many options as you please!

If you require support for multiple option selection, check the ‘multiple’ check-box in the form.

This tool can be used to create HTML drop downs with too many options like a drop down menu of all countries, drop down menu of timezones, drop down menu of languages etc.

Let me know if you encounter any bugs or need help with any issue.

Visit HTML drop down code generator

2017 All rights reserved | Powered by WordPress
Back to top
Theme by