JavaScript Text box not showing decimal values jQuery

Don't use parseInt to convert text to numbers unless the result you want really is an integer. parseFloat or Number will do the job here. ;)

Answer:1

Just remove parseint and let it be rval=$(a).val();

Answer:2

Use this JS:

function amtcal(id)
{    
    var ab="#a"+id;
    var ntwt=parseFloat($(ab).val());
    var a="#"+id;
    var rval=parseFloat($(a).val());
    var product=rval*ntwt;
    var abc="#aa"+id;
    $(abc).val(parseFloat(product).toFixed(2));
} 

Here .toFixed() is used to show 2 digits after decimal point.

Answer:3

Ok, I am bugging on this for 2nd day already, and it should be really simple... but it's not working. I am trying to load a video in a separate div, when a link from a nested list (in another div) ...

Ok, I am bugging on this for 2nd day already, and it should be really simple... but it's not working. I am trying to load a video in a separate div, when a link from a nested list (in another div) ...

I have a namespace generator that looks like this: (As a requirement, it also needs to have prototype objects extra and default). function generateNamespace(staticMethods, prototypeMethods){ ...

I have a namespace generator that looks like this: (As a requirement, it also needs to have prototype objects extra and default). function generateNamespace(staticMethods, prototypeMethods){ ...

I am new to angularJS and am trying to use it to get data from a json file. When I run the program the console reads out there is a 404 error and that the file does not exist. Here is the angular i ...

I am new to angularJS and am trying to use it to get data from a json file. When I run the program the console reads out there is a 404 error and that the file does not exist. Here is the angular i ...

I have a site here. Here's the code from my little form... <form method="get" action="https://www.google.com/search" target="_blank"> <table border="0" cellpadding="0"> <...

I have a site here. Here's the code from my little form... <form method="get" action="https://www.google.com/search" target="_blank"> <table border="0" cellpadding="0"> <...

  1. display text text
  2. display text from text file in html
  3. display text in text box html
  4. display text on mouseover for text in html
  5. tkinter display text in text box
  6. excel if text display text