<p id=”demo”>Click the button to display the formatted number.</p>
<button onclick=”myFunction()”>Try it</button>

<script type=”text/javascript”>// <![CDATA[
function myFunction()
{
var x = 4.99999;
x = Math.floor(x * 100) / 100;
alert(x.toFixed(2)); // alerts 4.99
}
// ]]></script>

&nbsp;

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get all fix get all the fixes for CSS, Jquery and any web2.0 related queries
Set your Twitter account name in your settings to use the TwitterBar Section.