Adding Integers and Floats via a single JavaScript Function

I was trying to add some numbers in JavaScript and they were getting concatenated. I saw various solutions on the net and then I came up with the following solution using Number function which was able to handle both integers and floats.

http://sites.google.com/site/spyderhoodcommunity/tech-stuff/javascriptaddingintegersandfloats

JavaScript Add 2 Numbers

JavaScript Add 2 Numbers

Advertisements

One thought on “Adding Integers and Floats via a single JavaScript Function

  1. Pingback: Adding Integers and Floats via a single JavaScript Function (via Kartik Sehgal’s Blog) « Yogesh Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s