javascript - Formating data pulled from the url -



javascript - Formating data pulled from the url -

i have script pulls parameter url , displays on page. problem need format decimal place value.

updated (this working now. give thanks all.)

code

$(document).ready(function () { var url = $.url('https://www.google.com/blah/blahblah/index.htm?x=50.5200'); var x = url.param('x'); var x2 = parsefloat(x).tofixed(2); $("#value").text(x2); });

try this:

var decimal = '50.5230'; var num = parsefloat(decimal).tofixed(2); console.log(num);

javascript jquery html url

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -