math - Calculation in Javascript without rounding decimal numbers -


Friends, I've got a text box in which users can enter valid decimal numbers.

And then calculate it without having scored with this decimal number.

Currently I am working as

  var pricePerItemExVat = Math.round ($ ("(#innerCaseWsp"). Val ()) / Math. ($ ("#increasium SLUNIT") .Val ());   

How can I do without spinning the number?

It seems that you get Math.round Is used.

Parsing only the strings using numbers:

  var pricePerItemExVat = ParseFloat ($ ("#InnerCaseWsp"). Val ()) / parseFloat ($ (" #InnerCaseItemSellUnit "). Val ());    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -