?
Solved

Rounding off to the next number

Posted on 2005-03-07
2
Medium Priority
?
162 Views
Last Modified: 2008-02-20
Hi,

I have a simple doubt

if i have a number like 5.5 or 5.8 it should off to 6
and if i have a number like 5.1 or 5.49 it should round off to 5 i dont want any decimal places like 5.00.

how do i do it in Javascript???
0
Comment
Question by:rajikrishna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 32

Accepted Solution

by:
ldbkutty earned 200 total points
ID: 13483997
<script>
alert(Math.round(5.4));
alert(Math.round(5.6));
</script>
0
 

Author Comment

by:rajikrishna
ID: 13484037
Its so easy
Thankx
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question