How to round up / round down / round nearest the values? Can anyone help to start somewhere ?

If the amount is = 3333.35 thenExpected Out Put-------------------------Round Exact:---------------------Round to Exact = $ 3333.35Round to $1 = $ 3333Round to $10 = $ 3330Round to $100 = $ 3300Round to $1000 = $ 3000Round Up-----------------------Round to Exact = $ 3333.35Round to $1 = $ 3334Round to $10 = $ 3340Round to $100 = $ 3400Round to $1000 = $ 4000Round Down----------------------------------Round to Exact = $ 3333.35Round to $1 = $ 3333Round to $10 = $ 3330Round to $100 = $ 3300Round to $1000 = $ 3000Round nearest---------------------------Round to Exact = $ 3333.35Round to $1 = $ 3333Round to $10 = $ 3330Round to $100 = $ 3300Round to $1000 = $ 3000

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Also notice the pattern
document.write ("\nRound to $10 = \t\t\$" + Math.round(amount/10)*10 + "\n");
since we are rounding to the nearest 10.00
we need to divide by 10.00
round
then multiply by 10

The same pattern exist for all lines:
document.write ("\nRound to Exact = \t\$" + Math.round(amount*100)/100 + "\n");
since we are rounding to the nearest .01
we need to divide by 0.01 (or multiply by 100 in algebraical terms)
round
then multiply by 0.01 (or divide by 100 in algebraical terms)

Therefore, for complete uniform pattern sake you could have written this instead:
document.write ("\nRound to Exact = \t\$" + Math.round(amount/0.01)*0.01 + "\n");
since it is the same as
document.write ("\nRound to Exact = \t\$" + Math.round(amount*100)/100 + "\n");

Thus,
the formula is:
Math.Round(amount / precision) * precision
So if you wanted 123456789 to the nearest 100,000.

amount=123456789;precision=100000;document.write (Math.round(amount / precision)*precision);//output is 123500000

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript â€¦

There are times when I have encountered the need to decompress a response from a PHP request.
This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.

This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

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)