Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Round textbox input to nearest thousand

Posted on 2005-04-04
1
Medium Priority
?
1,074 Views
Last Modified: 2008-03-03
I have a form which uses client side calculation, onblur(). I need to round the user input to the nearest thousand, for example if the user enters 550 then it must be rounded to 1000 or if the user enters 1200 then rounded to 1000. Is there any way to do this?
0
Comment
Question by:jerseybelle
1 Comment
 
LVL 31

Accepted Solution

by:
GwynforWeb earned 2000 total points
ID: 13703590
<input onblur="this.value=1000*Math.round(this.value/1000)">
0

Featured Post

Technology Partners: 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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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

578 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